PHP Class Gitamin\Services\Git\Repository

Inheritance: extends Gitter\Repository
Afficher le fichier Open project: gitaminhq/gitamin Class Usage Examples

Méthodes publiques

Méthode Description
createArchive ( string $tree, string $output, string $format = 'zip' ) Create a TAR or ZIP archive of a git tree.
getAuthorStatistics ( $branch )
getBlame ( string $file ) : array Blames the provided file and parses the output.
getCommit ( string $commitHash ) : array Show the data from a specific commit.
getHead ( $default = null ) Get the current branch, returning a default value when HEAD is detached.
getLatestCommit ( $file = null )
getPaginatedCommits ( string $file = null, $page ) : array Show the repository commit log with pagination.
getStatistics ( $branch )
hasCommit ( $commitHash ) : boolean Return true if the repo contains this commit.
pathExists ( string $commitish, string $path ) : boolean Return true if $path exists in $branch; return false otherwise.
readDiffLogs ( array $logs ) : array Read diff logs and generate a collection of diffs.
searchCommitLog ( $query, $branch )
searchTree ( $query, $branch )

Method Details

createArchive() public méthode

Create a TAR or ZIP archive of a git tree.
public createArchive ( string $tree, string $output, string $format = 'zip' )
$tree string Tree-ish reference
$output string Output File name
$format string Archive format

getAuthorStatistics() public méthode

public getAuthorStatistics ( $branch )

getBlame() public méthode

Blames the provided file and parses the output.
public getBlame ( string $file ) : array
$file string File that will be blamed
Résultat array Commits hashes containing the lines

getCommit() public méthode

Show the data from a specific commit.
public getCommit ( string $commitHash ) : array
$commitHash string Hash of the specific commit to read data
Résultat array Commit data

getHead() public méthode

Get the current branch, returning a default value when HEAD is detached.
public getHead ( $default = null )

getLatestCommit() public méthode

public getLatestCommit ( $file = null )

getPaginatedCommits() public méthode

Show the repository commit log with pagination.
public getPaginatedCommits ( string $file = null, $page ) : array
$file string
Résultat array Commit log

getStatistics() public méthode

public getStatistics ( $branch )

hasCommit() public méthode

Return true if the repo contains this commit.
public hasCommit ( $commitHash ) : boolean
$commitHash Hash of commit whose existence we want to check
Résultat boolean Whether or not the commit exists in this repo

pathExists() public méthode

Return true if $path exists in $branch; return false otherwise.
public pathExists ( string $commitish, string $path ) : boolean
$commitish string Commitish reference; branch, tag, SHA1, etc.
$path string Path whose existence we want to verify.
Résultat boolean GRIPE Arguably belongs in Gitter, as it's generally useful functionality. Also, this really may not be the best way to do this.

readDiffLogs() public méthode

Read diff logs and generate a collection of diffs.
public readDiffLogs ( array $logs ) : array
$logs array Array of log rows
Résultat array Array of diffs

searchCommitLog() public méthode

public searchCommitLog ( $query, $branch )

searchTree() public méthode

public searchTree ( $query, $branch )