consolidation/version-tool

Template project for PHP libraries.

0.1.8 2018-12-12 23:58 UTC

README

The version-tool identifies the type and version of several popular projects.

Travis CI Windows CI Scrutinizer Code Quality Coverage Status License

Getting Started

Download the latest version-tool.phar from the releases page. Run chmod +x version-tool.phar, rename to version-tool, and move to some directory in your $PATH (e.g. /usr/local/bin).

version-tool will tell you what program and what version exists in the current working directory:

$ version-tool info
program: Drupal 
version: 8.6.1

Detected frameworks:

  • Drupal 8
  • Drupal 7
  • Drupal 6
  • WordPress

Using the API

The Version Tool may also be included in another project as a library.

$ composer require consolidation/version-tool

Then, call as follows:

    $version_info = new VersionTool();
    $info = $version_info->info($path);
    $app = $info->application();
    $version = $info->version();

Running the tests

The test suite may be run locally by way of some simple composer scripts:

Test Command
Run all tests composer test
PHPUnit tests composer unit
PHP linter composer lint
Code style composer cs
Fix style errors composer cbf

Deployment

  • Edit the VERSION file to contain the version to release followed by "-dev", and commit the change.
  • Run composer release

Contributing

Please read CONTRIBUTING.md for details on the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the releases page.

Authors

  • Greg Anderson - created project from template.

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details