cvs: pear /PHP_Archive Archive.php package.php package.xml /PHP_Archive/Archive Creator.php /PHP_Archive/tests gopearphar.php.inc require_once.phpt
test_require.php /PHP_Archive/tests/require_once makerequire_oncephar.php.inc require_once.phar

From: Date: Wed, 20 Jul 2005 22:11:50 +0000
Subject: cvs: pear /PHP_Archive Archive.php package.php package.xml /PHP_Archive/Archive Creator.php /PHP_Archive/tests gopearphar.php.inc require_once.phpt
test_require.php /PHP_Archive/tests/require_once makerequire_oncephar.php.inc require_once.phar
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33169@lists.php.net to get a copy of this message
cellog Wed Jul 20 18:11:50 2005 EDT Added files: /pear/PHP_Archive/tests require_once.phpt test_require.php /pear/PHP_Archive/tests/require_once makerequire_oncephar.php.inc require_once.phar Modified files: /pear/PHP_Archive Archive.php package.php package.xml /pear/PHP_Archive/Archive Creator.php /pear/PHP_Archive/tests gopearphar.php.inc Log: fix error reporting add test for invalid require_once of internal file

http://cvs.php.net/diff.php/pear/PHP_Archive/Archive.php?r1=1.13&r2=1.14&ty=u Index: pear/PHP_Archive/Archive.php diff -u pear/PHP_Archive/Archive.php:1.13 pear/PHP_Archive/Archive.php:1.14 --- pear/PHP_Archive/Archive.php:1.13 Sat May 28 23:23:43 2005 +++ pear/PHP_Archive/Archive.php Wed Jul 20 18:11:50 2005 @@ -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.13 2005/05/29 03:23:43 cellog Exp $ + * @version $Id: Archive.php,v 1.14 2005/07/20 22:11:50 cellog Exp $ * @package PHP_Archive * @category PHP */ @@ -598,7 +598,7 @@ */ function APIVersion() { - return '@API-VER@'; + return '0.5'; } } http://cvs.php.net/diff.php/pear/PHP_Archive/package.php?r1=1.4&r2=1.5&ty=u Index: pear/PHP_Archive/package.php diff -u pear/PHP_Archive/package.php:1.4 pear/PHP_Archive/package.php:1.5 --- pear/PHP_Archive/package.php:1.4 Tue May 3 15:12:52 2005 +++ pear/PHP_Archive/package.php Wed Jul 20 18:11:50 2005 @@ -1,17 +1,10 @@ <?php require_once 'PEAR/PackageFileManager.php'; -$version = '0.5.0'; +$version = '0.6.0'; $notes = <<<EOT - * Full support for multiple .phars! phar://pharname.phar/file - and phar://phar2.phar/anotherfile will work now - * Fix gz compression - * remove Archive_Tar dep for non-creation - * remove preg dep for non-creation - * bundle PHP_Archive in all created .phars - standalone! Only - compressed .phars have a dep on zlib - * Add support for filenames > 100 characters in length and unit test - * Add full support for stat()/is_file()/is_dir()/is_readable() etc., opendir()/readdir() + * change error_reporting to E_ALL. Was stupidly using + E_ERROR | E_WARNING | E_PARSE | E_NOTICE EOT; $description =<<<EOT http://cvs.php.net/diff.php/pear/PHP_Archive/package.xml?r1=1.6&r2=1.7&ty=u Index: pear/PHP_Archive/package.xml diff -u pear/PHP_Archive/package.xml:1.6 pear/PHP_Archive/package.xml:1.7 --- pear/PHP_Archive/package.xml:1.6 Tue May 3 15:12:52 2005 +++ pear/PHP_Archive/package.xml Wed Jul 20 18:11:50 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0"> -<package version="1.0" packagerversion="1.4.0a12"> +<package version="1.0" packagerversion="1.4.0a13"> <name>PHP_Archive</name> <summary>Create and Use PHP Archive files</summary> <description>PHP_Archive allows you to create a single .phar file containing an entire application. @@ -20,19 +20,12 @@ </maintainer> </maintainers> <release> - <version>0.5.0</version> - <date>2005-05-03</date> + <version>0.6.0</version> + <date>2005-07-20</date> <license>PHP License</license> <state>alpha</state> - <notes>* Full support for multiple .phars! phar://pharname.phar/file - and phar://phar2.phar/anotherfile will work now - * Fix gz compression - * remove Archive_Tar dep for non-creation - * remove preg dep for non-creation - * bundle PHP_Archive in all created .phars - standalone! Only - compressed .phars have a dep on zlib - * Add support for filenames &gt; 100 characters in length and unit test - * Add full support for stat()/is_file()/is_dir()/is_readable() etc., opendir()/readdir() + <notes>* change error_reporting to E_ALL. Was stupidly using + E_ERROR | E_WARNING | E_PARSE | E_NOTICE </notes> <deps> <dep type="php" rel="ge" version="4.3.0" optional="no"/> @@ -98,6 +91,15 @@ </release> <changelog> <release> + <version>0.6.0</version> + <date>2005-07-20</date> + <license>PHP License</license> + <state>alpha</state> + <notes>* change error_reporting to E_ALL. Was stupidly using + E_ERROR | E_WARNING | E_PARSE | E_NOTICE + </notes> + </release> + <release> <version>0.5.0</version> <date>2005-05-03</date> <license>PHP License</license> http://cvs.php.net/diff.php/pear/PHP_Archive/Archive/Creator.php?r1=1.11&r2=1.12&ty=u Index: pear/PHP_Archive/Archive/Creator.php diff -u pear/PHP_Archive/Archive/Creator.php:1.11 pear/PHP_Archive/Archive/Creator.php:1.12 --- pear/PHP_Archive/Archive/Creator.php:1.11 Fri Apr 15 00:31:24 2005 +++ pear/PHP_Archive/Archive/Creator.php Wed Jul 20 18:11:50 2005 @@ -31,7 +31,7 @@ * @copyright Copyright © David Shafik and Synaptic Media 2004. All rights reserved. * @author Davey Shafik <davey@synapticmedia.net> * @link http://www.synapticmedia.net Synaptic Media - * @version $Id: Creator.php,v 1.11 2005/04/15 04:31:24 cellog Exp $ + * @version $Id: Creator.php,v 1.12 2005/07/20 22:11:50 cellog Exp $ * @package PHP_Archive * @category PHP * @example c:\web\php-cvs\pear\PHP_Archive\docs\examples\PHP_Archive_Creator_Example_1.php Example PHP_Archive_Creator usage @@ -108,7 +108,7 @@ -error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); +error_reporting(E_ALL); if (!class_exists('PHP_Archive')) { $contents } http://cvs.php.net/diff.php/pear/PHP_Archive/tests/gopearphar.php.inc?r1=1.2&r2=1.3&ty=u Index: pear/PHP_Archive/tests/gopearphar.php.inc diff -u pear/PHP_Archive/tests/gopearphar.php.inc:1.2 pear/PHP_Archive/tests/gopearphar.php.inc:1.3 --- pear/PHP_Archive/tests/gopearphar.php.inc:1.2 Fri Apr 15 23:40:18 2005 +++ pear/PHP_Archive/tests/gopearphar.php.inc Wed Jul 20 18:11:50 2005 @@ -15,8 +15,9 @@ $config = &PEAR_Config::singleton(); $ui = &PEAR_Frontend::singleton('PEAR_Frontend_CLI'); -$dl = &new PEAR_Downloader($ui, array('downloadonly' => true, 'nodeps' => true), $config); -$dl->setDownloadDir(dirname(__FILE__)); +$dl = &new PEAR_Downloader($ui, array('downloadonly' => true, 'nodeps' => true, + 'nocompress' => true), $config); +$dl->setDownloadDir(dirname(__FILE__) . '/go-pear-tarballs'); $res = &$dl->download(array_values($packages)); $pkg = &new PEAR_PackageFile($config); @@ -188,9 +189,11 @@ '*PEAR/PackageFile.php', '*PEAR/Registry.php', '*PEAR/Remote.php', + '*PEAR/Start.php', '*PEAR/Validate.php', '*PEAR/XMLParser.php', 'PEAR.php', + 'go-pear-phar.php', '*OS/Guess.php', '*Archive/Tar.php', '*Console/Getopt.php', http://cvs.php.net/co.php/pear/PHP_Archive/tests/require_once.phpt?r=1.1&p=1 Index: pear/PHP_Archive/tests/require_once.phpt +++ pear/PHP_Archive/tests/require_once.phpt --TEST-- Test running a .phar that requires a non-existent internal file --SKIPIF-- --FILE-- <?php require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpt_test.php.inc'; require_once 'PHP/Archive.php'; ini_set('html_errors', 0); require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'require_once' . DIRECTORY_SEPARATOR . 'require_once.phar'; echo 'tests done'; ?> --EXPECTF-- phar://require_once.phar/indexhooha.php Fatal error: Error: "nosuchfile.php" not found in phar "require_once.phar" in %s on line 355 http://cvs.php.net/co.php/pear/PHP_Archive/tests/test_require.php?r=1.1&p=1 Index: pear/PHP_Archive/tests/test_require.php +++ pear/PHP_Archive/tests/test_require.php <?php echo __FILE__; require_once 'phar://require_once.phar/nosuchfile.php'; ?> http://cvs.php.net/co.php/pear/PHP_Archive/tests/require_once/makerequire_oncephar.php.inc?r=1.1&p=1 Index: pear/PHP_Archive/tests/require_once/makerequire_oncephar.php.inc +++ pear/PHP_Archive/tests/require_once/makerequire_oncephar.php.inc <?php require_once 'PHP/Archive/Creator.php'; chdir(dirname(__FILE__)); $creator = new PHP_Archive_Creator('indexhooha.php', true); $creator->addFile(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'test_require.php', 'indexhooha.php'); $creator->savePhar(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'require_once.phar'); @unlink($name); ?> http://cvs.php.net/co.php/pear/PHP_Archive/tests/require_once/require_once.phar?r=1.1&p=1 Index: pear/PHP_Archive/tests/require_once/require_once.phar +++ pear/PHP_Archive/tests/require_once/require_once.phar <?php #PHP_ARCHIVE_HEADER-0.5.0.php 0 0 0 51260 0 10451 error_reporting(E_ALL); if (!class_exists('PHP_Archive')) { /** * PHP_Archive Class (implements .phar) * * @package PHP_Archive * @category PHP */ /** * PHP_Archive Class (implements .phar) * * PHAR files a singular archive from which an entire application can run. * To use it, simply package it using {@see PHP_Archive_Creator} and use phar:// * URIs to your includes. i.e. require_once 'phar://config.php' will include config.php * from the root of the PHAR file. * * Tar/Gz code borrowed from the excellent File_Archive package by Vincent Lascaux. * * @copyright Copyright © David Shafik and Synaptic Media 2004. All rights reserved. * @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.13 2005/05/29 03:23:43 cellog Exp $ * @package PHP_Archive * @category PHP */ class PHP_Archive { /** * @var string Current phar basename (like PEAR.phar) */ var $_basename; /** * @var string Archive filename */ var $archiveName = null; /** * Current Stat info of the current file in the tar */ var $currentStat = null; /** * Current file name in the tar * @var string */ var $currentFilename = null; /** * Length of the current tar file * @var int */ var $internalFileLength = 0; /** * Length of the current tar file's footer * @var int */ var $footerLength = 0; /** * @var string Content of the file being requested */ var $file = null; /** * @var resource|null Pointer to open .phar */ var $_file = null; /** * @var int length of the current archive */ var $_filelen = null; /** * @var int Current Position of the pointer */ var $position = 0; /** * @param string basename of the phar to cache stat from. * @static */ function cacheStat($pharname) { if (!isset($GLOBALS['_PHP_ARCHIVE_CACHE'])) { $GLOBALS['_PHP_ARCHIVE_CACHE'] = array(); } $GLOBALS['_PHP_ARCHIVE_CACHE'][$pharname] = array(); } /** * @param string * @access private */ function _processFile($path) { if ($path == '.') { return ''; } $std = str_replace("\\", "/", $path); while ($std != ($std = ereg_replace("[^\/:?]+/\.\./", "", $std))) ; $std = str_replace("/./", "", $std); if (strncmp($std, "./", 2) == 0) { return substr($std, 2); } else { return $std; } } /** * Seek in the master archive to a matching file or directory * @param string */ function _selectFile($path) { $std = $this->_processFile($path); $this->_index = 0; while (($error = $this->_nextFile()) === true) { if (empty($std) || $std == $this->currentFilename || //$std is a directory strncmp($std.'/', $this->currentFilename, strlen($std)+1) == 0) { if (isset($this->cachedFpos)) { @fseek($this->_file, $this->cachedFpos); } return true; } } if (@ftell($this->_file) >= $this->_filelen) { return 'Error: "' . $path . '" not found in phar "' . $this->_basename . '"'; } return $error; } /** * Process a raw tar header and extract file name, size, and additional info * @param string contents of the header * @uses $footerLength sets the footer length * @uses $internalFileLength sets the file length, if filename < 100 chars * @uses $currentStat sets the file statistics * @return array|string a string is returned on error * @access private */ function _processHeader($rawHeader) { if (strlen($rawHeader) < 512 || $rawHeader == pack("a512", "")) { return 'Error: phar "' . $this->archiveName . '" has corrupted tar header'; } $header = unpack( "a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/". "a8checksum/a1type/a100linkname/a6magic/a2version/". "a32uname/a32gname/a8devmajor/a8devminor/a155path", $rawHeader); $this->currentStat = array( 2 => octdec($header['mode']), 4 => octdec($header['uid']), 5 => octdec($header['gid']), 7 => octdec($header['size']), 9 => octdec($header['mtime']) ); $this->internalFileLength = $this->currentStat[7]; if ($this->internalFileLength % 512 == 0) { $this->footerLength = 0; } else { $this->footerLength = 512 - $this->internalFileLength % 512; } return $header; } /** * Seek to the next file, if any, and verify its integrity * @return boolean|array|string if a cached file is used, true is returned. False is returned * for a directory entry, and the raw header unpacked is returned * on seek success. On error, a string is returned * @access private */ function _nextFile() { if (isset($GLOBALS['_PHP_ARCHIVE_CACHE']) && isset($GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename]) && isset($GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][$this->_index])) { $this->currentFilename = $GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][$this->_index]['file']; $this->currentStat = $GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][$this->_index]['stat']; $this->internalFileLength = $GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][$this->_index]['length']; $this->cachedFpos = $GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][$this->_index]['fpos']; $this->footerLength = $GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][$this->_index]['footerlen']; $this->_index++; return true; } if (isset($this->cachedFpos)) { @fseek($this->_file, $this->cachedFpos); } @fread($this->_file, $this->internalFileLength + $this->footerLength); $rawHeader = @fread($this->_file, 512); $header = $this->_processHeader($rawHeader); if (is_string($header)) { return $header; } if ($header['type'] == '5') { return false; // directory entry } if ($header['type'] == 'L') { // filenames longer than 100 characters // borrowed from Archive_Tar written by Vincent Blavet $longFilename = ''; $n = floor($header['size']/512); for ($i=0; $i < $n; $i++) { $content = @fread($this->_file, 512); $longFilename .= $content; } if (($header['size'] % 512) != 0) { $content = @fread($this->_file, 512); $longFilename .= $content; } // ----- Read the next header $newHeader = @fread($this->_file, 512); $header = $this->_processHeader($newHeader); if (is_string($header)) { return $header; } $header['filename'] = trim($longFilename); $rawHeader = $newHeader; } $this->currentFilename = $this->_processFile($header['path'] . $header['filename']); $checksum = 8 * ord(" "); if (version_compare(phpversion(), '5.0.0', '>=')) { $c1 = str_split(substr($rawHeader, 0, 512)); $checkheader = array_merge(array_slice($c1, 0, 148), array_slice($c1, 156)); if (!function_exists('_PharDoChecksum')) { function _PharDoChecksum($a, $b) {return $a + ord($b);} } $checksum += array_reduce($checkheader, '_PharDoChecksum'); } else { for ($i = 0; $i < 148; $i++) { $checksum += ord($rawHeader{$i}); } for ($i = 156; $i < 512; $i++) { $checksum += ord($rawHeader{$i}); } } if (octdec($header['checksum']) != $checksum) { return 'Error: phar "' . $this->archiveName . '" Checksum error on entry "' . $this->currentFilename . '"'; } if (isset($GLOBALS['_PHP_ARCHIVE_CACHE']) && isset($GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename])) { $GLOBALS['_PHP_ARCHIVE_CACHE'][$this->_basename][] = array( 'file' => $this->currentFilename, 'stat' => $this->currentStat, 'length' => $this->internalFileLength, 'fpos' => @ftell($this->_file), 'footerlen' => $this->footerLength, ); $this->cachedFpos = null; } $this->_index++; return true; } /** * Seek to a file within the master archive, and extract its contents * @param string * @return array|string an array containing an error message string is returned * upon error, otherwise the file contents are returned */ function extractFile($path) { $this->_file = @fopen($this->archiveName, "rb"); $stat = fstat($this->_file); $this->_filelen = $stat['size']; if (!$this->_file) { return array('Error: cannot open phar "' . $this->archiveName . '"'); } if (($e = $this->_selectFile($path)) === true) { $data = @fread($this->_file, $this->internalFileLength); @fclose($this->_file); return $data; } else { @fclose($this->_file); return array($e); } } /** * Locate the .phar archive in the include_path and detect the file to open within * the archive. * * Possible parameters are phar://filename_within_phar.ext or * phar://pharname.phar/filename_within_phar.ext * * phar://filename_within_phar.ext will simply use the last .phar opened. * @param string a file within the archive * @return string the filename within the .phar to retrieve */ function initializeStream($file) { $aname = get_included_files(); $this->archiveName = 'phar://'; if (strpos($file, '.phar')) { // grab the basename of the phar we want $test = substr($file, 0, strpos($file, '.phar') + 5); } else { $test = false; } while (count($aname)) { $this->archiveName = array_pop($aname); if (strpos($this->archiveName, 'phar://') === false) { if ($test) { if (strpos($this->archiveName, $test)) { break; } } else { break; } } } if ($test && $this->archiveName != 'phar://') { $this->_basename = $test; $file = substr($file, strlen($test) + 1); if (!$file) { $file = '/'; // this is for opendir requests } } return $file; } /** * Open the requested file - PHP streams API * * @param string $file String provided by the Stream wrapper * @access private */ function stream_open($file) { return $this->_streamOpen($file); } /** * @param string filename to opne, or directory name * @param bool if true, a directory will be matched, otherwise only files * will be matched * @uses trigger_error() * @return bool success of opening * @access private */ function _streamOpen($file, $searchForDir = false) { $path = substr($file, 7); $path = $this->initializeStream($path); if ($this->archiveName == 'phar://') { trigger_error('Error: Unknown phar in "' . $file . '"', E_USER_ERROR); } if (is_array($this->file = $this->extractFile($path))) { trigger_error($this->file[0], E_USER_ERROR); return false; } if ($path != $this->currentFilename) { if (!$searchForDir) { trigger_error("Cannot open '$file', is a directory", E_USER_ERROR); return false; } else { $this->file = ''; return true; } } $compressed = $this->file ? (int) $this->file{0} : false; $this->file ? $this->file = substr($this->file, 1) : false; if ($compressed) { if (!function_exists('gzinflate')) { trigger_error('Error: zlib extension is not enabled - gzinflate() function needed' . ' for compressed .phars'); return false; } $this->file = base64_decode($this->file); $header = substr($this->file, 0, 10); $temp = unpack("Vcrc32/Visize", substr($this->file, -8)); $id = @unpack("H2id1/H2id2/C1tmp/C1flags", substr($header, 0, 4)); if ($id['id1'] != "1f" || $id['id2'] != "8b") { trigger_error("Not valid gz file (wrong header)", E_USER_ERROR); return false; } $this->file = gzinflate(substr($this->file, 10, strlen($this->file) - 8)); if ($temp['isize'] != strlen($this->file)) { trigger_error("Not valid gz file (size error {$size} != " . strlen($this->file) . ")", E_USER_ERROR); return false; } if ($temp['crc32'] != crc32($this->file)) { trigger_error("Not valid gz file (checksum error)", E_USER_ERROR); return false; } } if (!is_null($this->file) && $this->file !== false) { return true; } else { return false; } } /** * Read the data - PHP streams API * * @param int * @access private */ function stream_read($count) { $ret = substr($this->file, $this->position, $count); $this->position += strlen($ret); return $ret; } /** * Whether we've hit the end of the file - PHP streams API * @access private */ function stream_eof() { return !($this->position >= strlen($this->file)); } /** * For seeking the stream - PHP streams API * @param int * @param SEEK_SET|SEEK_CUR|SEEK_END * @access private */ function stream_seek($pos, $whence) { switch ($whence) { case SEEK_SET: if ($pos < 0) { return false; } $this->position = $pos; break; case SEEK_CUR: if ($pos + strlen($this->file) < 0) { return false; } $this->position += $pos; break; case SEEK_END: if ($pos + strlen($this->file) < 0) { return false; } $this->position = $pos + strlen($this->file); default: return false; } return true; } /** * The current position in the stream - PHP streams API * @access private */ function stream_tell() { return $this->position; } /** * The result of an fstat call, returns mod time from tar, and file size - PHP streams API * @uses _stream_stat() * @access private */ function stream_stat() { return $this->_stream_stat(); } /** * Retrieve statistics on a file or directory within the .phar * @param string file/directory to stat * @access private */ function _stream_stat($file = null) { $std = $file ? $this->_processFile($file) : $this->currentFilename; $isdir = strncmp($std . '/', $this->currentFilename, strlen($std) + 1) == 0; $mode = $isdir ? 0040444 : 0100444; // 040000 = dir, 010000 = file // everything is readable, nothing is writeable return array( 0, 0, $mode, 0, 0, 0, 0, 0, 0, 0, 0, 0, // non-associative indices 'dev' => 0, 'ino' => 0, 'mode' => $mode, 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'blksize' => 0, 'blocks' => 0, 'size' => strlen($this->file), 'atime' => $this->currentStat[9], 'mtime' => $this->currentStat[9], 'ctime' => $this->currentStat[9], ); } /** * Stat a closed file or directory - PHP streams API * @param string * @param int * @access private */ function url_stat($url, $flags) { $this->_streamOpen($url, true); $url = substr($url, 7); $path = $this->initializeStream($url); return $this->_stream_stat($path); } /** * Open a directory in the .phar for reading - PHP streams API * @param string directory name * @access private */ function dir_opendir($path) { $info = parse_url($path); $path = !empty($info['path']) ? $info['host'] . $info['path'] : $info['host'] . '/'; $path = $this->initializeStream($path); if ($this->archiveName == 'phar://') { trigger_error('Error: Unknown phar in "' . $file . '"', E_USER_ERROR); return false; } $this->_file = @fopen($this->archiveName, "rb"); $stat = fstat($this->_file); $this->_filelen = $stat['size']; if (!$this->_file) { return array('Error: cannot open phar "' . $this->archiveName . '"'); } $this->_dirFiles = array(); while (($error = $this->_nextFile()) === true) { if (strpos($this->currentFilename, '#PHP_ARCHIVE_HEADER-0.5.0.php')) { continue; } if ($path == '/') { if (strpos($this->currentFilename, '/')) { $this->_dirFiles[array_shift(explode('/', $this->currentFilename))] = true; } else { $this->_dirFiles[$this->currentFilename] = true; } } elseif (strpos($this->currentFilename, $path) === 0) { $fname = substr($this->currentFilename, strlen($path) + 1); if (strpos($fname, '/')) { $this->_dirFiles[array_unshift(explode('/', $fname))] = true; } else { $this->_dirFiles[$fname] = true; } } } @fclose($this->_file); @uksort($this->_dirFiles, 'strnatcmp'); return true; } /** * Read the next directory entry - PHP streams API * @access private */ function dir_readdir() { $ret = key($this->_dirFiles); @next($this->_dirFiles); if (!$ret) { return false; } return $ret; } /** * Close a directory handle opened with opendir() - PHP streams API * @access private */ function dir_closedir() { $this->_dirFiles = array(); reset($this->_dirFiles); return true; } /** * Rewind to the first directory entry - PHP streams API * @access private */ function dir_rewinddir() { reset($this->_dirFiles); return true; } /** * API version of this class * @return string */ function APIVersion() { return '@API-VER@'; } } } if (PHP_Archive::APIVersion() != '0.5') { die('Error: PHP_Archive must be API version 0.5 - use bundled PHP_Archive for success'); } @ini_set('memory_limit', -1); if (!function_exists('stream_get_wrappers')) {function stream_get_wrappers(){return array();}} if (!in_array('phar', stream_get_wrappers())) { stream_wrapper_register('phar', 'PHP_Archive'); } require_once 'phar://' . basename(__FILE__) . '/indexhooha.php'; if (count(get_included_files()) > 1) { return; } else { exit; } ?> <?php __HALT_PHP_PARSER__; ?> indexhooha.php 0 0 0 171 0 6266 1H4sIAMKt3kIC/7OxL8go4OXi5UpNzshXiI938/RxjY+35uUqSi0szSxKjc/PS05VUC/ISCyy0tdHFtQDienn5ReXJmekZeaA+AXqQI32dgCIpA6hVAAAAA==
« previous php.pear.cvs (#33169) next »