PHP Класс git, gitblog

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$query_count Query counter
$status_cache Cached git status structure

Открытые методы

Метод Описание
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

Описание методов

add() статический публичный Метод

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

cat_file() статический публичный Метод

static public cat_file ( $ids )

commit() статический публичный Метод

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

config() статический публичный Метод

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

diff() статический публичный Метод

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 escargs ( $args )

exec() статический публичный Метод

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

id_for_pathspec() статический публичный Метод

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

init() статический публичный Метод

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

ls_basic() статический публичный Метод

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

ls_modified() статический публичный Метод

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

ls_removed() статический публичный Метод

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

ls_staged() статический публичный Метод

static public ls_staged ( $paths = null )

ls_untracked() статический публичный Метод

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

reset() статический публичный Метод

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

status() статический публичный Метод

git status
static public status ( $raw = false, $cached = true ) : array
Результат 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, ... )] )

Описание свойств

$query_count публичное статическое свойство

Query counter
public static $query_count

$status_cache публичное статическое свойство

Cached git status structure
public static $status_cache