Use a saner file name for package archives
parent
bcbc50c0d6
commit
33828b38df
|
@ -75,12 +75,13 @@ class ArchiveManager
|
|||
|
||||
// Directory used to download the sources
|
||||
$filesystem = new Filesystem();
|
||||
$packageName = $package->getUniqueName();
|
||||
$packageName = preg_replace('#[^a-z0-9-_.]#i', '-', $package->getPrettyString());
|
||||
$sourcePath = sys_get_temp_dir().'/composer_archiver/'.$packageName;
|
||||
$filesystem->ensureDirectoryExists($sourcePath);
|
||||
|
||||
// Archive filename
|
||||
$target = $targetDir.'/'.$packageName.'.'.$format;
|
||||
$filesystem->ensureDirectoryExists($targetDir);
|
||||
$target = realpath($targetDir).'/'.$packageName.'.'.$format;
|
||||
$filesystem->ensureDirectoryExists(dirname($target));
|
||||
|
||||
// Download sources
|
||||
|
|
|
@ -63,7 +63,7 @@ class ArchiveManagerTest extends ArchiverTest
|
|||
|
||||
protected function getTargetName(PackageInterface $package, $format)
|
||||
{
|
||||
$packageName = $package->getUniqueName();
|
||||
$packageName = preg_replace('#[^a-z0-9-_.]#i', '-', $package->getPrettyString());
|
||||
$target = $this->targetDir.'/'.$packageName.'.'.$format;
|
||||
|
||||
return $target;
|
||||
|
|
Loading…
Reference in New Issue