Bug #55441 [Opn->Bgs]: \Phar::createDefaultStub() does not handle its arguments
| From: | bjori@php.net | Date: | Mon, 29 Aug 2011 15:03:15 +0000 |
| Subject: | Bug #55441 [Opn->Bgs]: \Phar::createDefaultStub() does not handle its arguments | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163105@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55441&edit=1
ID: 55441
Updated by: bjori@php.net
Reported by: frederic dot hardy at mageekbox dot net
Summary: \Phar::createDefaultStub() does not handle its
arguments
-Status: Open
+Status: Bogus
Type: Bug
Package: PHAR related
Operating System: MacOS X 10.6.8
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
You are looking for $phar->setDefaultStub() or $phar->setStub($phar-
>createDefaultStub());
Previous Comments:
------------------------------------------------------------------------
[2011-08-22 19:44:34] frederic dot hardy at mageekbox dot net
<?php
$phar = new phar('createDefaultStub.phar');
$phar['cli.php'] = '<?php echo \'CLI\' . PHP_EOL; ?>';
$phar['web.php'] = '<?php echo \'WEB\' . PHP_EOL; ?>';
$phar->createDefaultStub('cli.php', 'web.php');
?>
# php createDefaultStub.phar
PHP Warning: include(phar:///path/to/createDefaultStub.phar/index.php): failed
to open stream: phar error: "index.php" is not a file in phar
"/path/to/createDefaultStub.phar" in /path/to/createDefaultStub.phar on line 9
------------------------------------------------------------------------
[2011-08-22 14:13:29] kalle@php.net
By quickly skimming over the source it seems that in order for this function to work both parameters
must have a value. Have you tried that?
------------------------------------------------------------------------
[2011-08-17 13:43:16] frederic dot hardy at mageekbox dot net
Description:
------------
\Phar::createDefaultStub() takes two optional arguments.
With these arguments, the user can defined file in phar archive which will be used
in stub.
However, these arguments seems to be not used by \Phar::createDefaultStub().
Test script:
---------------
<?php
# In CLI, do php -d phar.readonly=0 path/to/this/script to generate my.phar.
# In CLI, do php my.phar
$phar = new \phar('my.phar');
$phar['stub.php'] = '<?php echo 'This is the stub !'; ?>';
$phar->createDefaultStub('stub.php');
Expected result:
----------------
This is the stub !
Actual result:
--------------
PHP Warning: include(phar:///path/to/my.phar/index.php): failed to open stream:
phar error: "index.php" is not a file in phar "/path/to/my.phar" in
/path/to/my.phar on line 9
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55441&edit=1