![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| cellog Sat May 19 19:23:26 2007 UTC Modified files: /pear/PHP_Archive Archive.php Log: fix opendir() and stat of a non-existent directory http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PHP_Archive/Archive.php diff -u pear/PHP_Archive/Archive.php:1.39 pear/PHP_Archive/Archive.php:1.40 --- pear/PHP_Archive/Archive.php:1.39 Fri May 18 03:49:36 2007 +++ pear/PHP_Archive/Archive.php Sat May 19 19:23:26 2007 @@ -19,7 +19,7 @@ * @author Davey Shafik <davey@synapticmedia.net> * @author Greg Beaver <cellog@php.net> * @link http://www.synapticmedia.net Synaptic Media - * @version $Id: Archive.php,v 1.39 2007/05/18 03:49:36 cellog Exp $ + * @version $Id: Archive.php,v 1.40 2007/05/19 19:23:26 cellog Exp $ * @package PHP_Archive * @category PHP */ @@ -857,6 +857,22 @@ $this->_setCurrentFile($file); $isdir = false; } else { + do { + $isdir = false; + if ($file == '/') { + break; + } + foreach (self::$_manifest[$this->_archiveName] as $path => $info) { + if (strpos($path, $file) === 0) { + if (strlen($path) > strlen($file) && + $path[strlen($file)] == '/') { + break 2; + } + } + } + // no files exist and no directories match this string + return false; + } while (false); $isdir = true; } } else { @@ -934,11 +950,11 @@ } elseif (strpos($file, $path) === 0) { $fname = substr($file, strlen($path) + 1); if (strpos($fname, '/')) { + // this is a directory $a = explode('/', $fname); $this->_dirFiles[array_shift($a)] = true; - } elseif (strlen($file) != strlen($path)) { - // if the two match exactly, the path searched for was - // not a directory, but was a file. + } elseif ($file[strlen($path)] == '/') { + // this is a file $this->_dirFiles[$fname] = true; } } | |||
| Featured Websites | ||||
|
![]() |
| Tags: archivephp, cvs, pear, php_archive |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cvs: pear /PHP_Archive Archive.php package.php package.xml /PHP_Archive/Archive Creator.php /PHP_Archive/data phar_frontcontroller.tpl | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR/PackageFile/Generator v2.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR Installer.php /PEAR/PackageFile v1.php /PEAR/PackageFile/v2 Validator.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear-core / package-PEAR.xml package2.xml /PEAR Downloader.php /PEAR/Downloader Package.php | Greg Beaver | Pear | 0 | 05-20-2007 7:42 PM |
| pear install doesn't work due to bug in Archive/Tar | Lars Petersen | Pear | 1 | 05-20-2007 7:41 PM |
| Featured Websites | ||||
|