PHP code example of antalaron / git-version
1. Go to this page and download the library: Download antalaron/git-version library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
antalaron / git-version example snippets
$gitVersion = new \Antalaron\GitVersion\GitVersion();
$gitVersion->getVersion(__DIR__);
// or static
\Antalaron\GitVersion\GitVersion::getGitVersion(__DIR__);
$gitVersion = new \Antalaron\GitVersion\GitVersion();
$gitVersion->getLatestCommit(__DIR__);
// or static
\Antalaron\GitVersion\GitVersion::getGitLatestCommit(__DIR__);
$gitVersion = new \Antalaron\GitVersion\GitVersion();
$gitVersion->getLatestCommitDetails(__DIR__);
// or static
\Antalaron\GitVersion\GitVersion::getGitLatestCommitDetails(__DIR__);