PHP 인터페이스 TQ\Vcs\Repository\RepositoryInterface

파일 보기 프로젝트 열기: teqneers/php-stream-wrapper-for-git 0 사용 예제들

공개 메소드들

메소드 설명
add ( array $file = null, boolean $force = false ) Adds one or more files to the staging area
commit ( string $commitMsg, array $file = null, string | null $author = null, array $extraArgs = [] ) Commits the currently staged changes into the repository
createDirectory ( string $path, string | null $commitMsg = null, integer | null $dirMode = null, boolean $recursive = true, string | null $author = null ) : string Writes data to a file and commit the changes immediately
getCurrentCommit ( ) : string Returns the current commit hash
getLog ( integer | null $limit = null, integer | null $skip = null ) : array Returns the current repository log
getObjectInfo ( string $path, string $ref = 'HEAD' ) : array Returns information about an object at a given version
getRepositoryPath ( ) : string Returns the full file system path to the repository
isDirty ( ) : boolean Returns true if there are uncommitted changes in the working directory and/or the staging area
listDirectory ( string $directory = '.', string $ref = 'HEAD' ) : array List the directory at a given version
removeFile ( string $path, string | null $commitMsg = null, boolean $recursive = false, boolean $force = false, string | null $author = null ) : string Removes a file and commit the changes immediately
renameFile ( string $fromPath, string $toPath, string | null $commitMsg = null, boolean $force = false, string | null $author = null ) : string Renames a file and commit the changes immediately
reset ( ) Resets the working directory and/or the staging area and discards all changes
resolveFullPath ( string | array $path ) : string Resolves a path relative to the repository into an absolute path
resolveLocalPath ( string | array $path ) : string Resolves an absolute path into a path relative to the repository path
showCommit ( string $hash ) : string Returns a string containing information about the given commit
showFile ( string $file, string $ref = 'HEAD' ) : string Returns the content of a file at a given version
writeFile ( string $path, string | array $data, string | null $commitMsg = null, integer | null $fileMode = null, integer | null $dirMode = null, boolean $recursive = true, string | null $author = null ) : string Writes data to a file and commit the changes immediately

메소드 상세

add() 공개 메소드

Adds one or more files to the staging area
public add ( array $file = null, boolean $force = false )
$file array The file(s) to be added or NULL to add all new and/or changed files to the staging area
$force boolean

commit() 공개 메소드

Commits the currently staged changes into the repository
public commit ( string $commitMsg, array $file = null, string | null $author = null, array $extraArgs = [] )
$commitMsg string The commit message
$file array Restrict commit to the given files or NULL to commit all staged changes
$author string | null The author
$extraArgs array Allow the user to pass extra args eg array('-i')

createDirectory() 공개 메소드

Writes data to a file and commit the changes immediately
public createDirectory ( string $path, string | null $commitMsg = null, integer | null $dirMode = null, boolean $recursive = true, string | null $author = null ) : string
$path string The directory path
$commitMsg string | null The commit message used when committing the changes
$dirMode integer | null The mode for creating the intermediate directories
$recursive boolean Create intermediate directories recursively if required
$author string | null The author
리턴 string The current commit hash

getCurrentCommit() 공개 메소드

Returns the current commit hash
public getCurrentCommit ( ) : string
리턴 string

getLog() 공개 메소드

Returns the current repository log
public getLog ( integer | null $limit = null, integer | null $skip = null ) : array
$limit integer | null The maximum number of log entries returned
$skip integer | null Number of log entries that are skipped from the beginning
리턴 array

getObjectInfo() 공개 메소드

The information returned is an array with the following structure array( 'type' => blob|tree|commit, 'mode' => 0040000 for a tree, 0100000 for a blob, 0 otherwise, 'size' => the size )
public getObjectInfo ( string $path, string $ref = 'HEAD' ) : array
$path string The path to the object
$ref string The version ref
리턴 array The object info

getRepositoryPath() 공개 메소드

Returns the full file system path to the repository
public getRepositoryPath ( ) : string
리턴 string

isDirty() 공개 메소드

Returns true if there are uncommitted changes in the working directory and/or the staging area
public isDirty ( ) : boolean
리턴 boolean

listDirectory() 공개 메소드

List the directory at a given version
public listDirectory ( string $directory = '.', string $ref = 'HEAD' ) : array
$directory string The path ot the directory
$ref string The version ref
리턴 array

removeFile() 공개 메소드

Removes a file and commit the changes immediately
public removeFile ( string $path, string | null $commitMsg = null, boolean $recursive = false, boolean $force = false, string | null $author = null ) : string
$path string The file path
$commitMsg string | null The commit message used when committing the changes
$recursive boolean True to recursively remove subdirectories
$force boolean True to continue even though VCS reports a possible conflict
$author string | null The author
리턴 string The current commit hash

renameFile() 공개 메소드

Renames a file and commit the changes immediately
public renameFile ( string $fromPath, string $toPath, string | null $commitMsg = null, boolean $force = false, string | null $author = null ) : string
$fromPath string The source path
$toPath string The destination path
$commitMsg string | null The commit message used when committing the changes
$force boolean True to continue even though VCS reports a possible conflict
$author string | null The author
리턴 string The current commit hash

reset() 공개 메소드

Resets the working directory and/or the staging area and discards all changes
public reset ( )

resolveFullPath() 공개 메소드

Resolves a path relative to the repository into an absolute path
public resolveFullPath ( string | array $path ) : string
$path string | array A local path (or an array of paths)
리턴 string

resolveLocalPath() 공개 메소드

Resolves an absolute path into a path relative to the repository path
public resolveLocalPath ( string | array $path ) : string
$path string | array A file system path (or an array of paths)
리턴 string

showCommit() 공개 메소드

Returns a string containing information about the given commit
public showCommit ( string $hash ) : string
$hash string The commit ref
리턴 string

showFile() 공개 메소드

Returns the content of a file at a given version
public showFile ( string $file, string $ref = 'HEAD' ) : string
$file string The path to the file
$ref string The version ref
리턴 string

writeFile() 공개 메소드

Writes data to a file and commit the changes immediately
public writeFile ( string $path, string | array $data, string | null $commitMsg = null, integer | null $fileMode = null, integer | null $dirMode = null, boolean $recursive = true, string | null $author = null ) : string
$path string The file path
$data string | array The data to write to the file
$commitMsg string | null The commit message used when committing the changes
$fileMode integer | null The mode for creating the file
$dirMode integer | null The mode for creating the intermediate directories
$recursive boolean Create intermediate directories recursively if required
$author string | null The author
리턴 string The current commit hash