Skip to content

Add version specification for PHARs #1

@eduardocruz

Description

@eduardocruz

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions