|
@@ 193-200 (lines=8) @@
|
| 190 |
|
|
| 191 |
|
// Open the source directory to read in files |
| 192 |
|
$iterator = new DirectoryIterator($src); |
| 193 |
|
foreach ($iterator as $fObj) { |
| 194 |
|
if ($fObj->isFile()) { |
| 195 |
|
rename($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
| 196 |
|
} elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 197 |
|
// Try recursively on directory |
| 198 |
|
static::rmove($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
| 199 |
|
} |
| 200 |
|
} |
| 201 |
|
$iterator = null; // clear iterator Obj to close file/directory |
| 202 |
|
return rmdir($src); // remove the directory & return results |
| 203 |
|
} |
|
@@ 235-241 (lines=7) @@
|
| 232 |
|
|
| 233 |
|
// Open the source directory to read in files |
| 234 |
|
$iterator = new DirectoryIterator($src); |
| 235 |
|
foreach($iterator as $fObj) { |
| 236 |
|
if($fObj->isFile()) { |
| 237 |
|
copy($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
| 238 |
|
} else if(!$fObj->isDot() && $fObj->isDir()) { |
| 239 |
|
static::rcopy($fObj->getPathname(), $dest . '/' . $fObj-getFilename()); |
| 240 |
|
} |
| 241 |
|
} |
| 242 |
|
return true; |
| 243 |
|
} |
| 244 |
|
|