Changeset 21564 for branches/version-2_12-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2012/03/01 10:06:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/util/SC_Utils.php
r21563 r21564 2192 2192 /** 2193 2193 * 指定されたパスの配下を再帰的にコピーします. 2194 * @param string $imageDir コピー元ディレクトリのパス 2195 * @param string $destDir コピー先ディレクトリのパス 2194 * @param string $imageDir コピー元ディレクトリのパス 2195 * @param string $destDir コピー先ディレクトリのパス 2196 * @return void 2196 2197 */ 2197 2198 function copyDirectory($source_path, $dest_path) { … … 2199 2200 $handle=opendir($source_path); 2200 2201 while ($filename = readdir($handle)) { 2201 if ($filename === '.' || $filename === '..') continue;2202 if ($filename === '.' || $filename === '..') continue; 2202 2203 $cur_path = $source_path . $filename; 2203 2204 $dest_file_path = $dest_path . $filename; … … 2205 2206 // ディレクトリの場合 2206 2207 // コピー先に無いディレクトリの場合、ディレクトリ作成. 2207 if (!empty($filename) && !file_exists($dest_file_path)) mkdir($dest_file_path);2208 if (!empty($filename) && !file_exists($dest_file_path)) mkdir($dest_file_path); 2208 2209 SC_Utils_EX::copyDirectory($cur_path . '/', $dest_file_path . '/'); 2209 2210 } else { 2210 if (file_exists($dest_file_path)) unlink($dest_file_path);2211 if (file_exists($dest_file_path)) unlink($dest_file_path); 2211 2212 copy($cur_path, $dest_file_path); 2212 2213 } … … 2214 2215 } 2215 2216 2217 /** 2218 * 文字列を区切り文字を挟み反復する 2219 * @param string $input 繰り返す文字列。 2220 * @param string $multiplier input を繰り返す回数。 2221 * @param string $separator 区切り文字 2222 * @return string 2223 */ 2224 function repeatStrWithSeparator($input, $multiplier, $separator = ',') { 2225 return implode($separator, array_fill(0, $multiplier, $input)); 2226 } 2216 2227 }
Note: See TracChangeset
for help on using the changeset viewer.
