php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60953 Bug adding file extension using convertToExecutable()
Submitted: 2012-02-02 13:05 UTC Modified: 2013-10-15 11:54 UTC
From: trq at proemframework dot org Assigned: ralphschindler (profile)
Status: No Feedback Package: PHAR related
PHP Version: 5.4.0RC6 OS: Linux dev 2.6.32-042stab016.1 #1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 - 4 = ?
Subscribe to this entry?

 
 [2012-02-02 13:05 UTC] 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

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-05 19:42 UTC] ralphschindler@php.net
-Assigned To: +Assigned To: ralphschindler
 [2013-06-16 22:53 UTC] stas@php.net
-Status: Assigned +Status: Feedback
 [2013-06-16 22:53 UTC] stas@php.net
Please see some notes in the patch.
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 07:04:07 2022 UTC