PHP Class git, gitblog

Show file Open project: rsms/gitblog Class Usage Examples

Public Properties

Property Type Description
$query_count Query counter
$status_cache Cached git status structure

Public Methods

Method Description
add ( $pathspec, $forceIncludeIgnored = true )
cat_file ( $ids )
commit ( $message, $author = null, $pathspec = null, $deferred = false )
config ( $key = null, $value = null, $guess_repo = true ) # -----------------------------------------------------------------------------------------------
diff ( $commits = null, $paths = null, $args = null ) Each argument can be a string or and array of strings (or null to skip)
escargs ( $args )
exec ( $cmd, $input = null, $gitdir = null, $worktree = null, $allow_guess = false, $ignore_git_errors = false ) Execute a git command
id_for_pathspec ( $pathspec ) Retrieve ids for $pathspec (string or array of strings) at the current branch head
init ( $gitdir = null, $worktree = null, $shared = 'true' )
ls_basic ( $args = null, $paths = null )
ls_modified ( $paths = null, $exclude = null )
ls_removed ( $paths = null, $exclude = null )
ls_staged ( $paths = null )
ls_untracked ( $paths = null, $exclude = null )
reset ( $pathspec = null, $commitobj = null, $flags = '-q' )
status ( $raw = false, $cached = true ) : array git status

Method Details

add() static public method

static public add ( $pathspec, $forceIncludeIgnored = true )

cat_file() static public method

static public cat_file ( $ids )

commit() static public method

static public commit ( $message, $author = null, $pathspec = null, $deferred = false )

config() static public method

# -----------------------------------------------------------------------------------------------
static public config ( $key = null, $value = null, $guess_repo = true )

diff() static public method

Each argument can be a string or and array of strings (or null to skip)
static public diff ( $commits = null, $paths = null, $args = null )

escargs() static public method

static public escargs ( $args )

exec() static public method

Execute a git command
static public exec ( $cmd, $input = null, $gitdir = null, $worktree = null, $allow_guess = false, $ignore_git_errors = false )

id_for_pathspec() static public method

Retrieve ids for $pathspec (string or array of strings) at the current branch head
static public id_for_pathspec ( $pathspec )

init() static public method

static public init ( $gitdir = null, $worktree = null, $shared = 'true' )

ls_basic() static public method

static public ls_basic ( $args = null, $paths = null )

ls_modified() static public method

static public ls_modified ( $paths = null, $exclude = null )

ls_removed() static public method

static public ls_removed ( $paths = null, $exclude = null )

ls_staged() static public method

static public ls_staged ( $paths = null )

ls_untracked() static public method

static public ls_untracked ( $paths = null, $exclude = null )

reset() static public method

static public reset ( $pathspec = null, $commitobj = null, $flags = '-q' )

status() static public method

git status
static public status ( $raw = false, $cached = true ) : array
return array array( 'branch' => 'master', ['upstream' => array('name' => 'origin/master', 'distance' => 24),] ['staged' => array( 'filename' => array('status'=>'added'|'modified'|'deleted') | array('status'=>'renamed','newname'=>'filename') ], ... ),] ['unstaged' => array( 'filename' => array('status'=>'added'|'modified'|'deleted') | array('status'=>'renamed','newname'=>'filename') ], ... ),] ['untracked' => array( 'filename' => 1, ... )] )

Property Details

$query_count public static property

Query counter
public static $query_count

$status_cache public static property

Cached git status structure
public static $status_cache