ID: 45726
Updated by: [EMAIL PROTECTED]
Reported By: Bjorn dot Wiberg at its dot uu dot se
-Status: Open
+Status: Assigned
Bug Type: PHAR related
Operating System: *
PHP Version: 5.3CVS-2008-08-06
Assigned To: helly
Previous Comments:
------------------------------------------------------------------------
[2008-10-02 23:19:59] [EMAIL PROTECTED]
Well, I think that we should add a check for directory, as it's
possible to some OSs `cat /dir/`.
Index: ext/phar/phar/pharcommand.inc
===================================================================
RCS file: /repository/php-src/ext/phar/phar/pharcommand.inc,v
retrieving revision 1.49.2.12
diff -u -r1.49.2.12 pharcommand.inc
--- ext/phar/phar/pharcommand.inc 12 Sep 2008 16:09:01 -0000
1.49.2.12
+++ ext/phar/phar/pharcommand.inc 2 Oct 2008 23:10:22 -0000
@@ -488,7 +488,9 @@
if (isset($loader)) {
$s = "<?php if
(!class_exists('PHP_Archive')) {\n?>";
- $s .= file_get_contents($loader);
+ if (!is_dir($loader)) {
+ $s .=
file_get_contents($loader);
+ }
$s .= "<?php\n";
$s .= "}\n";
$s .= "if (!in_array('phar',
stream_get_wrappers())) {\n";
------------------------------------------------------------------------
[2008-09-16 12:21:01] Bjorn dot Wiberg at its dot uu dot se
Noticed that buildconf checks the MAKE environment variable, so made
sure that it uses GNU make by setting MAKE on the command line. Then the
buildconf call works.
But the PHAR error persists. (And, --disable-all --enable-phar is not
very useful, right?)
So, again, awaiting any response to felipe's comments.
---8<---
L/users/project/PDP/PDP_51_vac_6_14/usr/lib -lz -lm -lz -ljpeg -lssl
-lcrypto -lgdbm -lbz2 -lz -lssl -lcrypto -lm -lz -liconv -lm -lcurl
-lssl -lcrypto -lz -lssl -lcrypto -lz -lz -liconv -lm -lz -liconv -lm
-lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz
-liconv -lm -lz -liconv -lm -lxslt -lz -liconv -lm -lxml2 -lpthread -lz
-liconv -lm -lz -liconv -lm
-Wl,-blibpath:/usr/local/lib:/opt/freeware/lib:/usr/X11R6/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../..:/usr/lib:/lib
ld: 0711-224 WARNING: Duplicate symbol: php_optidx
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
ld: 0711-783 WARNING: TOC overflow. TOC size: 73936 Maximum size:
65536
Extra instructions are being generated for each reference to a
TOC
symbol if the symbol is in the TOC overflow area.
Generating phar.php
Generating phar.phar
Pear package PHP_Archive or Archive.php class file not found.
Fatal error: Uncaught exception 'PharException' with message 'illegal
stub for phar
"/home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.phar"' in
/home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.php:994
Stack trace:
#0 /home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.php(994):
Phar->setStub('#!/apache/php/b...')
#1 /home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.php(1054):
PharCommand->phar_set_stub_begin(Object(Phar), '/home/bwiberg/r...',
'/home/bwiberg/r...', '/apache/php/bin...')
#2 [internal function]: PharCommand->cli_cmd_run_pack(Array)
#3 /home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.php(225):
call_user_func(Array, Array)
#4 /home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.php(2073):
CLICommand->__construct(19, Array)
#5 {main}
thrown in
/home/bwiberg/rpm/BUILD/php5.3-200809161030/ext/phar/phar.php on line
994
make: *** [ext/phar/phar.phar] Error 255
Bad exit status from /var/opt/freeware/tmp/rpm-tmp.12271 (%build)
[EMAIL PROTECTED]:~/rpm/SPECS$
--->8---
------------------------------------------------------------------------
[2008-09-16 12:03:51] Bjorn dot Wiberg at its dot uu dot se
It doesn't like my autoconf, so running buildconf is unfortunately a
no-go for me...
Awaiting responses to felipe's comments instead -- they sound very
interesting!
Best regards,
Björn
---8<---
+ ./buildconf --force
Forcing buildconf
using default Zend directory
buildconf: checking installation...
buildconf: autoconf version 2.59 (ok)
buildconf: Your version of autoconf likely contains buggy cache code.
Running cvsclean for you.
To avoid this, install autoconf-2.13.
"build/build2.mk", line 32: make: Dependency line needs colon or double
colon operator.
"build/build2.mk", line 33: make: Dependency line needs colon or double
colon operator.
"build/build2.mk", line 35: make: Dependency line needs colon or double
colon operator.
make: Fatal errors encountered -- cannot continue.
make: The error code from the last command is 2.
--->8---
------------------------------------------------------------------------
[2008-09-14 15:13:07] [EMAIL PROTECTED]
s/php executable path/php directory/
The file_get_contents() is reading the dir. as a real file.
sapi/cli/php -r 'var_dump(file_get_contents("/home/felipe/php5"));'
string(2560) "��l
.�k
..-�l
buildmk.stamp��.�l
CVS��l▒
.cvsignoreB�.gdbinitw�U��CODING_STANDARDS�j��CREDITS��l
------------------------------------------------------------------------
[2008-09-14 13:48:05] [EMAIL PROTECTED]
Hi,
I can reproduce on BSD.
The php executable path (/usr/home/felipe/php5) is being passed to
phar_set_stub_begin() in the $loader parameter, hence the binary is
included in string passed to $phar->setStub();
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45726
--
Edit this bug report at http://bugs.php.net/?id=45726&edit=1