mazanax / composer-project-version
Small helper to get current composer project version
Installs: 7 523
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-10-20 17:14:43 UTC
README
Composer Package Version
Helper function to get a current version from composer.json
file in your project
If you want to get separate values of major/minor/patch version, you can try mazanax/composer-version-semver
Installation
composer require mazanax/composer-project-version
Usage
• PackageVersion class
<?php $packageVersion = \MZNX\ComposerPackageVersion\PackageVersion::init(__DIR__ . '/path/to/composer.json'); $version = $packageVersion->getVersion();
• Version function
$packageVersion = \MZNX\ComposerPackageVersion\Version(__DIR__ . '/path/to/composer.json');
License
MIT