Skip to content

Determine your project version from either a commit.json or from your git repository.

License

Notifications You must be signed in to change notification settings

the-kbA-team/version

Repository files navigation

Version

License: MIT Build Status Maintainability Test Coverage

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.
 */

About

Determine your project version from either a commit.json or from your git repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages