Modified:
trunk/Lux/Filesystem.php
Log:
Call Solar_Dir::fix(), so we don't need to worry with slashes in the
passed $to value.
Modified: trunk/Lux/Filesystem.php
==============================================================================
--- trunk/Lux/Filesystem.php (original)
+++ trunk/Lux/Filesystem.php Tue Mar 4 21:43:39 2008
@@ -52,12 +52,15 @@
return;
}
+ // Fix dir name: always end with a slash.
+ $to = Solar_Dir::fix($to);
+
if (! file_exists($to)) {
// Create destination dir.
$this->createDir($to);
}
- $iter = new DirectoryIterator($from);
+ $iter = new DirectoryIterator($from);
foreach ($iter as $file) {
// Ignore dots and links.
@@ -66,7 +69,7 @@
}
// Increment the destination with the filename.
- $new_to = $to . DIRECTORY_SEPARATOR . $file->getFilename();
+ $new_to = $to . $file->getFilename();
// Copy recursivelly.
$this->copyDir($file->getPathname(), $new_to, $ignore);