From:
Operating system: Linux dev 2.6.32-042stab016.1 #1
PHP version: 5.4.0RC6
Package: PHAR related
Bug Type: Bug
Bug description:Bug adding file extension using convertToExecutable()
Description:
------------
When using convertToExecutable() to add compression to an existing phar
archive,
if the original phar name contains full stops . the new phar.tar.gz
extension is
added to early.
eg;
proem-0.1.2.phar
becomes:
proem-0.phar.tar.gz
Test script:
---------------
#!/usr/bin/env php
<?php
require 'lib/Proem/Api/Proem.php';
$phar = new Phar('build/proem-' . Proem\Api\Proem::VERSION . '.phar');
$phar->buildFromDirectory('lib');
$phar->setStub("<?php
Phar::mapPhar('proem.phar');
require_once 'phar://proem.phar/Proem/Autoloader.php';
(new Proem\Autoloader())->registerNamespaces(['Proem' =>
'lib'])->register();
__HALT_COMPILER();
?>");
$phar->convertToExecutable(Phar::TAR, Phar::GZ);
Expected result:
----------------
thorpe@dev[~/src/proem][master]+ ls -l build/
total 76
-rw-r--r-- 1 thorpe thorpe 64006 Feb 2 23:53 proem-0.1.2.phar
-rw-r--r-- 1 thorpe thorpe 8523 Feb 2 23:53 proem-0.1.2.phar.tar.gz
Actual result:
--------------
thorpe@dev[~/src/proem][master]+ ls -l build/
total 76
-rw-r--r-- 1 thorpe thorpe 64006 Feb 2 23:53 proem-0.1.2.phar
-rw-r--r-- 1 thorpe thorpe 8523 Feb 2 23:53 proem-0.phar.tar.gz
--
Edit bug report at https://bugs.php.net/bug.php?id=60953&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=60953&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=60953&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=60953&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=60953&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=60953&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=60953&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=60953&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=60953&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=60953&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=60953&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=60953&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=60953&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=60953&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=60953&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=60953&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60953&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=60953&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=60953&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=60953&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=60953&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=60953&r=mysqlcfg