From: Operating system: Mac OS X Lion 10.7.2 PHP version: 5.4.0RC1 Package: Built-in web server Bug Type: Bug Bug description:Phar::createDefaultStub runs indexfile, not webindexfile parameter
Description: ------------ When building a phar, you can use a default stub creator by using Phar::createDefaultStub. The first param should run from the CLI, the second from a web server. When using the built in CLI-web server and navigating to the phar, the file in the first param is run. When testing on apache the same file, it runs the second param. Test script: --------------- <?php $testPhar = new Phar('test.phar',null, 'test'); $testPhar->addFromString('cli.php', '<?php print "CLI".PHP_EOL;exit;'); $testPhar->addFromString('web.php', '<?php print "web".PHP_EOL;exit;'); $testPhar->setStub($testPhar->createDefaultStub('cli.php','web.php')); Expected result: ---------------- browser should simple output "web" Actual result: -------------- browser shows "CLI" when run from CLI web server -- Edit bug report at https://bugs.php.net/bug.php?id=60351&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60351&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60351&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60351&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60351&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60351&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60351&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60351&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60351&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60351&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60351&r=support Expected behavior: https://bugs.php.net/fix.php?id=60351&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60351&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60351&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60351&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60351&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60351&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60351&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60351&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60351&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60351&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60351&r=mysqlcfg