controlaltdelete/git-version

Find the current git version without using exec

v1.0.0 2017-04-09 09:12 UTC

This package is not auto-updated.

Last update: 2024-11-26 02:22:56 UTC


README

Control Alt Delete.nl

This package can be used to find the latest git tag. This can be used in various ways, IE for cache busting of your assets. It does not use exec, shell_exec, etc. It tries to read the files in your .git folder and retrieve the version from that.

Installation

composer require controlaltdelete/git-version

Usage

If the .git folder is the same folder as where the incoming request is made:

$version = \ControlAltDelete\GitVersion::find();

If the .git folder is somewhere else:

$version = \ControlAltDelete\GitVersion::find('path/to/.git/folder');