kba-team / version
Determine your project version from either a commit.json or from your git repository.
Installs: 12 707
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >7.0, <8.4
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^9.5
README
Determine your project version from either a commit.json or from your git repository.
Usage
composer require kba-team/version
Simple usage in your PHP code:
<?php use kbATeam\Version\Version; use kbATeam\Version\FileVersion; use kbATeam\Version\GitVersion; $version = new Version(); $version->register(new FileVersion(APP.DS.'webroot'.DS.'commit.json')); $version->register(new GitVersion(APP)); if ($version->exists()) { printf('%s (rev. %s)', $version->getBranch(), $version->getCommit()); } /** * prints `<branch> (rev. <commit ID>)` of your CakePHP project. */