PHP code example of sydnerdrage / php-gitver

1. Go to this page and download the library: Download sydnerdrage/php-gitver 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/ */

    

sydnerdrage / php-gitver example snippets


use \Gitver\Git;

App::uses('Controller', 'Controller');

class AppController extends Controller
{
    public function beforeFilter()
    {
        parent::beforeFilter();
        $this->set("VERSION", (new Git(__DIR__))->version());
    }