Public Member Functions | Public Attributes

Git Class Reference

Revision Control System Model for Git. More...

List of all members.

Public Member Functions

 type ()
 Get the repository type for this model.
 startup ($path)
 Startup the model initializing a path.
 authorize ($user, $passwd)
 Set authorization params for the model.
 cloneRemote ($url, $path=null, $branch= 'master')
 Clone a repository.
 up ($path=null)
 Update a repository.
 status ($path=null)
 Get the current status of the repository.
 branch ($path=null)
 Get the current branch.
 branches ($path=null, $remote=false)
 Get (remote) branches list.
 valid ($path=null)
 Check if the current or given path is a valid Git repository.
 lastCommit ($path=null)
 Get last commit data.
 command ($cmd)
 Exec a given Git command fill `lastCommand` and eventually `lastCommandCode` and `lastError` attributes.

Public Attributes

 $path = null
 $username = ''
 $passwd = ''
 $lastCommandCode = null
 $lastCommand = null
 $lastError = null

Detailed Description

Revision Control System Model for Git.

Definition at line 30 of file git.php.


Member Function Documentation

Git::authorize ( user,
passwd 
)

Set authorization params for the model.

Parameters:
string $user: the Git username
string $passwd: the Git user password
Returns:
void

Definition at line 66 of file git.php.

Git::branch ( path = null  ) 

Get the current branch.

Parameters:
string $path: optional. Can be a repository path
Returns:
string: the current branch name

Definition at line 147 of file git.php.

References command().

Referenced by up(), and valid().

Git::branches ( path = null,
remote = false 
)

Get (remote) branches list.

Parameters:
string $path: optional. Can be a repository path
boolean $remote: should fetch from remote
Returns:
array: a list of (remote) branches

Definition at line 166 of file git.php.

References command().

Git::cloneRemote ( url,
path = null,
branch = 'master' 
)

Clone a repository.

Parameters:
string $url: the repository remote url
string $path: where the repository should be checkouted
string $branch: the branch name to checkout
Returns:
array: the clone command results

Definition at line 79 of file git.php.

Git::command ( cmd  ) 

Exec a given Git command fill `lastCommand` and eventually `lastCommandCode` and `lastError` attributes.

Parameters:
string $cmd: the command to exec
Returns:
array: the result of the exec

Definition at line 251 of file git.php.

Referenced by branch(), branches(), lastCommit(), status(), and up().

Git::lastCommit ( path = null  ) 

Get last commit data.

Parameters:
string $path: optional. Can be a repository path
Returns:
array: a list of properties for the last commit

Definition at line 207 of file git.php.

References command().

Git::startup ( path  ) 

Startup the model initializing a path.

Parameters:
string $path: the repository path
Returns:
void

Definition at line 55 of file git.php.

Git::status ( path = null  ) 

Get the current status of the repository.

Parameters:
string $path: optional. Can be a repository path
Returns:
array: the status command results

Definition at line 125 of file git.php.

References command().

Git::type (  ) 

Get the repository type for this model.

Returns:
string: the repository type

Definition at line 45 of file git.php.

Git::up ( path = null  ) 

Update a repository.

Parameters:
string $path: optional. Can be a repository path to update
Returns:
array: the update command results

Definition at line 95 of file git.php.

References branch(), and command().

Git::valid ( path = null  ) 

Check if the current or given path is a valid Git repository.

Parameters:
string $path: optional. Can be a repository path
Returns:
boolean: is a valid repository or not

Definition at line 193 of file git.php.

References branch().


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:47 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus