Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow old PEAR/PECL named convention packages for pre-packaged source #193

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Platform/PrePackagedSourceAssetName.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ private function __construct()
public static function packageNames(Package $package): array
{
return [
// Ideal format for new PIE packages
strtolower(sprintf(
'php_%s-%s-src.tgz',
$package->extensionName()->name(),
Expand All @@ -31,6 +32,12 @@ public static function packageNames(Package $package): array
$package->extensionName()->name(),
$package->version(),
)),
// Old PEAR/PECL convention
strtolower(sprintf(
'%s-%s.tgz',
$package->extensionName()->name(),
$package->version(),
)),
];
}
}
1 change: 1 addition & 0 deletions test/unit/Downloading/DownloadUrlMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function testPrePackagedSourceDownloads(): void
[
'php_bar-1.2.3-src.tgz',
'php_bar-1.2.3-src.zip',
'bar-1.2.3.tgz',
],
$downloadUrlMethod->possibleAssetNames($package, $targetPlatform),
);
Expand Down
1 change: 1 addition & 0 deletions test/unit/Platform/PrePackagedSourceAssetNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function testPackageNames(): void
[
'php_foobar-1.2.3-src.tgz',
'php_foobar-1.2.3-src.zip',
'foobar-1.2.3.tgz',
],
PrePackagedSourceAssetName::packageNames(
new Package(
Expand Down