Changeset 21555 for branches/version-2_12-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2012/02/27 17:39:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/util/SC_Utils.php
r21552 r21555 2189 2189 SC_Utils_Ex::deleteFile(MOBILE_COMPILE_REALDIR, false); 2190 2190 } 2191 2192 /** 2193 * 指定されたパスの配下を再帰的にコピーします. 2194 * @param string $imageDir コピー元ディレクトリのパス 2195 * @param string $destDir コピー先ディレクトリのパス 2196 */ 2197 function copyDirectory($source_path, $dest_path) { 2198 2199 $handle=opendir($source_path); 2200 while($filename = readdir($handle)) { 2201 if($filename === '.' || $filename === '..') continue; 2202 $cur_path = $source_path . $filename; 2203 $dest_file_path = $dest_path . $filename; 2204 if(is_dir($cur_path)) { 2205 // ディレクトリの場合 2206 // コピー先に無いディレクトリの場合、ディレクトリ作成. 2207 if(!empty($filename) && !file_exists($dest_file_path)) mkdir($dest_file_path); 2208 SC_Utils_EX::copyDirectory($cur_path . '/', $dest_file_path . '/'); 2209 } else { 2210 if(file_exists($dest_file_path)) unlink($dest_file_path); 2211 copy($cur_path, $dest_file_path); 2212 } 2213 } 2214 } 2215 2191 2216 }
Note: See TracChangeset
for help on using the changeset viewer.
