public
string:
|
#
type( )
Get the repository type for this model
Get the repository type for this model
Returns
string: the repository type
|
public
|
#
startup( string $path )
Startup the model initializing a path.
Startup the model initializing a path.
Parameters
- $path
- $path: the repository path
|
public
|
#
authorize( string $user, string $passwd )
Set authorization params for the model
Set authorization params for the model
Parameters
- $user
- $user: the Git username
- $passwd
- $passwd: the Git user password
|
public
array:
|
#
cloneRemote( string $url, string $path = null, string $branch = 'master' )
Clone a repository
Parameters
- $url
- $url: the repository remote url
- $path
- $path: where the repository should be checkouted
- $branch
- $branch: the branch name to checkout
Returns
array: the clone command results
|
public
array:
|
#
up( string $path = null )
Update a repository
Parameters
- $path
- $path: optional. Can be a repository path to update
Returns
array: the update command results
|
public
array:
|
#
status( string $path = null )
Get the current status of the repository
Get the current status of the repository
Parameters
- $path
- $path: optional. Can be a repository path
Returns
array: the status command results
|
public
string:
|
#
branch( string $path = null )
Get the current branch
Parameters
- $path
- $path: optional. Can be a repository path
Returns
string: the current branch name
|
public
array:
|
#
branches( string $path = null, boolean $remote = false )
Get (remote) branches list
Get (remote) branches list
Parameters
- $path
- $path: optional. Can be a repository path
- $remote
- $remote: should fetch from remote
Returns
array: a list of (remote) branches
|
public
boolean:
|
#
valid( string $path = null )
Check if the current or given path is a valid Git repository
Check if the current or given path is a valid Git repository
Parameters
- $path
- $path: optional. Can be a repository path
Returns
boolean: is a valid repository or not
|
public
array:
|
#
lastCommit( string $path = null )
Get last commit data
Parameters
- $path
- $path: optional. Can be a repository path
Returns
array: a list of properties for the last commit
|
public
array:
|
#
command( string $cmd )
Exec a given Git command
fill lastCommand and eventually lastCommandCode and lastError attributes.
Exec a given Git command
fill lastCommand and eventually lastCommandCode and lastError attributes.
Parameters
- $cmd
- $cmd: the command to exec
Returns
array: the result of the exec
|