RE: [PEAR-DEV] Minor File_Find Patch
| From: | Alan Richmond | Date: | Thu, 24 Oct 2002 00:25:02 +0000 |
| Subject: | RE: [PEAR-DEV] Minor File_Find Patch | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10214@lists.php.net to get a copy of this message | ||
Looks like the attachment got stripped, it's pretty short so
here goes:
BEGIN
=============================
--- c:\php\pear\File\Find.php 2002-05-12 23:54:48.000000000
+0000
+++ Find.php 2002-10-22 21:03:50.000000000 +0000
@@ -144,7 +144,7 @@
$retval = array();
- $directory .= '/';
+ $directory .= DIRECTORY_SEPARATOR;
$dh=opendir($directory);
while ($entry = readdir($dh)) {
if ($entry != "." && $entry != "..") {
@@ -156,7 +156,7 @@
while (list($key, $val) = each($retval)) {
$path = $directory . $val;
- $path = str_replace("//","/",$path);
+ $path =
str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR,DIRECTOR
Y_SEPARATOR,$path);
if (!(is_array($val))) {
if (is_dir($path)) {
@@ -242,7 +242,7 @@
if ($entry != '.' &&
$entry != '..') {
- $entry = "$directory/$entry";
+ $entry =
$directory.DIRECTORY_SEPARATOR.$entry;
if (is_dir($entry))
array_push($this->_dirs, $entry);
=============================
END
> -----Original Message-----
> From: Alan Richmond [mailto:alan_richmond@netzero.net]
> Sent: Wednesday, October 23, 2002 5:19 PM
> To: pear-dev@lists.php.net
> Subject: [PEAR-DEV] Minor File_Find Patch
>
>
> Here's a small patch for File_Find. It simply changes the
> /'s to DIRECTORY_SEPARATORs so on windows systems the
paths
> don't have mixed directory seperators. Otherwise it's a
> real pain to do path manipulation.
>
> -Alan
>
>
>
>
>