PHP Class yii2tech\selfupdate\Git

See also: https://git-scm.com/
Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends VersionControlSystem
Show file Open project: yii2tech/selfupdate

Public Properties

Property Type Description
$binPath path to the 'git' bin command. By default simple 'git' is used assuming it available as global shell command. It could be '/usr/bin/git' for example.
$remoteName name of the GIT remote, which should be used to get changes.

Public Methods

Method Description
applyRemoteChanges ( string $projectRoot, string &$log = null ) : boolean Applies changes from remote repository.
getCurrentBranch ( string $projectRoot ) : string Returns currently active GIT branch name for the project.
hasRemoteChanges ( string $projectRoot, string &$log = null ) : boolean Checks, if there are some changes in remote repository.

Method Details

applyRemoteChanges() public method

Applies changes from remote repository.
public applyRemoteChanges ( string $projectRoot, string &$log = null ) : boolean
$projectRoot string VCS project root directory path.
$log string if parameter passed it will be filled with related log string.
return boolean whether the changes have been applied successfully.

getCurrentBranch() public method

Returns currently active GIT branch name for the project.
public getCurrentBranch ( string $projectRoot ) : string
$projectRoot string VCS project root directory path.
return string branch name.

hasRemoteChanges() public method

Checks, if there are some changes in remote repository.
public hasRemoteChanges ( string $projectRoot, string &$log = null ) : boolean
$projectRoot string VCS project root directory path.
$log string if parameter passed it will be filled with related log string.
return boolean whether there are changes in remote repository.

Property Details

$binPath public property

path to the 'git' bin command. By default simple 'git' is used assuming it available as global shell command. It could be '/usr/bin/git' for example.
public $binPath

$remoteName public property

name of the GIT remote, which should be used to get changes.
public $remoteName