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