Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #17 from fpoirotte/94_incorrect_package_name

Fix filename for packages with a dot in their name.
  • Loading branch information...
commit 30b26dc11e9065073f5264619ed311bc7ae456c3 2 parents 7113cc8 + d76cb0e
@saltybeagle saltybeagle authored
Showing with 3 additions and 14 deletions.
  1. +3 −14 src/Pyrus/Developer/Creator/Phar.php
View
17 src/Pyrus/Developer/Creator/Phar.php
@@ -81,7 +81,7 @@ function __construct($path, $stub = false, $fileformat = \Phar::TAR, $compressio
'releasing maintainer\'s certificate does not contain' .
' an alternate name corresponding to the releaser\'s email address');
}
-
+
if ($info['subject']['emailAddress'] != $new->maintainer[$releaser]->email) {
throw new \Pyrus\Developer\Creator\Exception(
'releasing maintainer\'s certificate ' .
@@ -126,16 +126,7 @@ function init()
if (file_exists($this->path)) {
@unlink($this->path);
}
- $ext = strstr(strrchr($this->path, '-'), '.');
- if (!$ext) {
- $ext = strstr(strrchr($this->path, '/'), '.');
- if (!$ext) {
- $ext = strstr(strrchr($this->path, '\\'), '.');
- }
- }
- if (!$ext) {
- $ext = strstr($this->path, '.');
- }
+ $ext = (string) strstr(basename($this->path), '.');
$a = $this->_classname;
$this->phar = new $a($this->path);
if ($this->phar instanceof \Phar) {
@@ -185,9 +176,7 @@ function close()
}
$this->phar->stopBuffering();
- $ext = str_replace(array('.tar', '.zip', '.tgz', '.phar'), array('', '', '', ''),
- basename($this->path)) . '.';
- $ext = substr($ext, strpos($ext, '.'));
+ $ext = (string) strstr(basename($this->path), '.');
$newphar = $this->phar;
if (count($this->others)) {
foreach ($this->others as $pathinfo) {

0 comments on commit 30b26dc

Please sign in to comment.
Something went wrong with that request. Please try again.