Edit report at https://bugs.php.net/bug.php?id=60953&edit=1
ID: 60953 Updated by: s...@php.net Reported by: trq at proemframework dot org Summary: Bug adding file extension using convertToExecutable() -Status: Assigned +Status: Feedback Type: Bug Package: PHAR related Operating System: Linux dev 2.6.32-042stab016.1 #1 PHP Version: 5.4.0RC6 Assigned To: ralphschindler Block user comment: N Private report: N New Comment: Please see some notes in the patch. Previous Comments: ------------------------------------------------------------------------ [2012-02-02 13:05:30] trq at proemframework dot org 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 this bug report at https://bugs.php.net/bug.php?id=60953&edit=1