[lux commit] r121 - trunk/Lux

0 views
Skip to first unread message

codesite...@google.com

unread,
Mar 5, 2008, 12:37:11 AM3/5/08
to lux...@googlegroups.com
Author: rodrigo.moraes
Date: Tue Mar 4 21:36:40 2008
New Revision: 121

Modified:
trunk/Lux/Filesystem.php

Log:
Uses getFilename(); no need for basename().

Modified: trunk/Lux/Filesystem.php
==============================================================================
--- trunk/Lux/Filesystem.php (original)
+++ trunk/Lux/Filesystem.php Tue Mar 4 21:36:40 2008
@@ -32,9 +32,9 @@
*
* Copies a directory recursivelly.
*
- * @param string $from From directory path.
+ * @param string $from Source directory path.
*
- * @param string $to To directory path.
+ * @param string $to Destination directory path.
*
* @param string $ignore Regular expression to ignore files or directories.
*
@@ -59,17 +59,17 @@

$iter = new DirectoryIterator($from);

- foreach($iter as $info) {
+ foreach ($iter as $file) {
// Ignore dots and links.
- if ($info->isDot() || (!$info->isFile()
&& !$info->isDir())) {
+ if ($file->isDot() || (! $file->isFile() && !
$file->isDir())) {
continue;
}

- // Increment the destination with the file/dir name.
- $new_to = $to . DIRECTORY_SEPARATOR . basename($info->getPathname());
+ // Increment the destination with the filename.
+ $new_to = $to . DIRECTORY_SEPARATOR . $file->getFilename();

// Copy recursivelly.
- $this->copyDir($info->getPathname(), $new_to, $ignore);
+ $this->copyDir($file->getPathname(), $new_to, $ignore);
}
}

Reply all
Reply to author
Forward
0 new messages