From: Operating system: Windows 7 PHP version: 5.3.9 Package: PHAR related Bug Type: Bug Bug description:Cannot include files from different .phars when include path is too long
Description: ------------ When including multiple .phar archieves into the code and one of the archieves contains for example an autoloading script to include files, the script breaks when the reference to the phar wrapper is too far back in the include path. It works anytime when using the phar:// wrapper and not when referencing the file via the include path. That is not helpful, when the provided autoloader of the framework does not care whether the file is within a different .phar. The two used .phars used can be downloaded here: http://dl.dropbox.com/u/3319901/autoload.phar http://dl.dropbox.com/u/3319901/libA.phar Just put those into the root directory with the test script code. To build the .phars I used the export functionality of Zend Studio, as well as a Phing target, both yielded the same results. Test script: --------------- <?php $phars = array( 'phar://libA.phar', 'phar://autoload.phar'); $usedPath = implode(PATH_SEPARATOR, $phars); //working with this include path length //set_include_path(str_pad(PATH_SEPARATOR . $usedPath, 218, 'a', STR_PAD_LEFT)); //NOT working with this include path length set_include_path(str_pad(PATH_SEPARATOR . $usedPath, 219, 'a', STR_PAD_LEFT)); include 'libA.phar'; include 'autoload.phar'; include 'autoload/autoload.php'; //works at any time autoload('phar://libA.phar/libA/libA.php'); //NOT working when include path is too long autoload('libA/libA.php'); Expected result: ---------------- included file phar://libA.phar/libA/libA.php included file phar://libA.phar/libA/libA.php Actual result: -------------- included file phar://libA.phar/libA/libA.php Warning: include() [function.include]: Failed opening 'libA/libA.php' for inclusion (include_path='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;phar://libA.phar;phar://autoload.phar') in phar://autoload.phar/autoload/autoload.php on line 5 -- Edit bug report at https://bugs.php.net/bug.php?id=60794&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60794&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60794&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60794&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60794&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60794&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60794&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60794&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60794&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60794&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60794&r=support Expected behavior: https://bugs.php.net/fix.php?id=60794&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60794&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60794&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60794&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60794&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60794&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60794&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60794&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60794&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60794&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60794&r=mysqlcfg