PHPX should support version specification for PHARs, similar to how we handle Composer packages.
Requirements
- Support syntax like
phpx php-cs-fixer.phar:3.26 fix src/
- Download and cache each version separately in the PHAR cache
- Update the registry to map to version-specific URL patterns
Implementation approach
We could modify the $knownPhars registry to support version mapping:
private array $knownPharVersions = [
'php-cs-fixer.phar' => [
'latest' => 'https://cs.symfony.com/download/php-cs-fixer-v3.phar',
'v3' => 'https://cs.symfony.com/download/php-cs-fixer-v3.phar',
'3.26' => 'https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.26.0/php-cs-fixer.phar'
]
];
This enhancement would provide more control to users who need specific versions of tools.
PHPX should support version specification for PHARs, similar to how we handle Composer packages.
Requirements
phpx php-cs-fixer.phar:3.26 fix src/Implementation approach
We could modify the
$knownPharsregistry to support version mapping:This enhancement would provide more control to users who need specific versions of tools.