src/Version.php
private function extractVersion()
    {
        $git = Executable::make($this->gitBin)
            ->addArgument(sprintf('--git-dir=%s', $this->gitPath))
            ->addArgument('describe')
            ->addArgument('--tags')
            ->addArgument('--always');

        try {
            $git->execute();
        } catch (\Ballen\Executioner\Exceptions\ExecutionException $exception) {
            // We could not obtain/execute the git command.
        }

        $version = trim($git->resultAsText());
        $this->version = '0.0.0-0-' . $version;

        if (strlen($version) > 7) {
            $this->version = str_replace('v', '', $version);
        }
        $this->versionBits();
    }
private function extractVersion()
    {
        $git = Executable::make($this->gitBin)
            ->addArgument(sprintf('--git-dir=%s', $this->gitPath))
            ->addArgument('describe')
            ->addArgument('--tags')
            ->addArgument('--always');

        try {
            $git->execute();
        } catch (\Ballen\Executioner\Exceptions\ExecutionException $exception) {
            // We could not obtain/execute the git command.
        }

        $version = trim($git->resultAsText());
        $this->version = '0.0.0-0-' . $version;

        if (strlen($version) > 7) {
            $this->version = str_replace('v', '', $version);
        }
        $this->versionBits();
    }
private function extractVersion ( ) { $ git = Executable :: make ( $ this -> gitBin ) -> addArgument ( sprintf ( '--git-dir=%s' , $ this -> gitPath ) ) -> addArgument ( 'describe' ) -> addArgument ( '--tags' ) -> addArgument ( '--always' ) ; try { $ git -> execute ( ) ; } catch ( \ Ballen \ Executioner \ Exceptions \ ExecutionException $ exception ) { // We could not obtain/execute the git command. } $ version = trim ( $ git -> resultAsText ( ) ) ; $ this -> version = '0.0.0-0-' . $ version ; if ( strlen ( $ version ) > 7 ) { $ this -> version = str_replace ( 'v' , '' , $ version ) ; } $ this -> versionBits ( ) ; }
Extracts the version from the Git repository.
@return void
Extracts the version from the Git repository .