PHP Class Banago\PHPloy\Git

Mostra file Open project: banago/phploy

Public Properties

Property Type Description
$branch Git branch
$revision Git revision

Protected Properties

Property Type Description
$repo Git repository

Public Methods

Method Description
__construct ( null $repo = null ) Git constructor.
checkout ( string $branch, string $repoPath = null ) : array Checkout given $branch.
command ( string $command, string $repoPath = null ) : array Runs a git command and returns the output (as an array).
diff ( string $remoteRevision, string $localRevision, string $repoPath = null ) : array Diff versions.
exec ( string $command ) : array Executes a console command and returns the output (as an array).

Method Details

__construct() public method

Git constructor.
public __construct ( null $repo = null )
$repo null

checkout() public method

Checkout given $branch.
public checkout ( string $branch, string $repoPath = null ) : array
$branch string
$repoPath string
return array

command() public method

Runs a git command and returns the output (as an array).
public command ( string $command, string $repoPath = null ) : array
$command string "git [your-command-here]"
$repoPath string Defaults to $this->repo
return array Lines of the output

diff() public method

Diff versions.
public diff ( string $remoteRevision, string $localRevision, string $repoPath = null ) : array
$remoteRevision string
$localRevision string
$repoPath string
return array

exec() public method

Executes a console command and returns the output (as an array).
public exec ( string $command ) : array
$command string Command to execute
return array of all lines that were output to the console during the command (STDOUT)

Property Details

$branch public_oe property

Git branch
public $branch

$repo protected_oe property

Git repository
protected $repo

$revision public_oe property

Git revision
public $revision