Bug #71317 [Com]: PharData fails to open specific file
Edit report at https://bugs.php.net/bug.php?id=71317&edit=1
ID: 71317
Comment by: chris dot kingslynne at gmail dot com
Reported by: weirdan at gmail dot com
Summary: PharData fails to open specific file
Status: Open
Type: Bug
Package: PHAR related
Operating System: Debian/sid
PHP Version: 7.0.2
Block user comment: N
Private report: N
New Comment:
I noticed this issue and posted about it here:
https://stackoverflow.com/questions/34667830/does-using-composer-to-install-pear-packages-work-in-php-7
This appears to critically affect the ability to use Composer under PHP 7 :(
Chris
Previous Comments:
------------------------------------------------------------------------
[2016-01-09 00:25:34] weirdan at gmail dot com
Description:
------------
There's a tar file that PharData fails to open: http://download.pear.php.net/package/Structures_Graph-1.1.1.tgz
(either gzipped or ungzipped).
It works with php 5.3 (vanilla), 5.6 (debian build), but fails starting with php 7.0.{0,1,2} (all
vanilla versions from php.net)
If I repack the archive (unpack and pack it back with tar cvf) it works fine. At first I thought the
cause of the problem was that the archive did not include directories, but other similar archive
(also without folder entries) http://download.pear.php.net/package/Console_CommandLine-1.2.1.tgz
opens just fine.
Test script:
---------------
#!/bin/bash
for ver in 5.3.29 system 7.0.0 7.0.1 7.0.2; do
phpenv local $ver
php -r 'echo phpversion() . "\n"; new
\PharData("bad/Structures_Graph-1.1.1.tar");'
done
Expected result:
----------------
5.3.29
5.6.16-4
7.0.0
7.0.1
7.0.2
Actual result:
--------------
5.3.29
5.6.16-4
7.0.0
PHP Fatal error: Uncaught UnexpectedValueException: phar error: tar-based phar
"Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered in Command line
code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
thrown in Command line code on line 1
7.0.1
PHP Fatal error: Uncaught UnexpectedValueException: phar error: tar-based phar
"Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered in Command line
code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
thrown in Command line code on line 1
7.0.2
PHP Fatal error: Uncaught UnexpectedValueException: phar error: tar-based phar
"Structures_Graph-1.1.1/tests/BasicGraphTest.php" cannot be registered in Command line
code:1
Stack trace:
#0 Command line code(1): PharData->__construct('bad/Structures_...')
#1 {main}
thrown in Command line code on line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71317&edit=1
Thread (8 messages)