Property | Type | Description | |
---|---|---|---|
$command | Path to git command. | ||
$debug | boolean | Debug flag, indicating if errors should be thrown. | |
$environmentVariables | array | Environment variables that should be set for every running process. | |
$gitDir | string | Directory containing git files. | |
$logger | Psr\Log\LoggerInterface | Logger (can be null). | |
$objects | array | Associative array, indexed by object hash | |
$processTimeout | integer | Timeout that should be set for every running process. | |
$referenceBag | Gitonomy\Git\ReferenceBag | Reference bag associated to this repository. | |
$workingDir | string | Working directory. |
Method | Description | |
---|---|---|
__construct ( string $dir, array $options = [] ) | Constructs a new repository. | |
cloneTo ( string $path, boolean $bare = true, array $options = [] ) : |
Clones the current repository to a new directory and return instance of new repository. | |
getBlame ( $revision, $file, $lineRange = null ) | ||
getBlob ( string $hash ) : Gitonomy\Git\Blob | Instanciates a blob object or fetches one from the cache. | |
getCommit ( string $hash ) : Gitonomy\Git\Commit | Instanciates a commit object or fetches one from the cache. | |
getDescription ( ) : string | Returns description of repository from description file in git directory. | |
getDiff ( $revisions ) : Gitonomy\Git\Diff\Diff | ||
getGitDir ( ) : string | Returns the directory containing git files (git-dir). | |
getHead ( ) : Gitonomy\Git\Reference | Gitonomy\Git\Commit | null | ||
getHeadCommit ( ) : Gitonomy\Git\Commit | null | Returns the HEAD resolved as a commit. | |
getHooks ( ) : Gitonomy\Git\Hooks | Returns the hooks object. | |
getLog ( array $revisions = null, array $paths = null, integer $offset = null, integer $limit = null ) : Gitonomy\Git\Log | Returns log for a given set of revisions and paths. | |
getLogger ( ) : Psr\Log\LoggerInterface | Returns repository logger. | |
getPath ( ) : string | Returns the path to the git repository. | |
getReferences ( ) : Gitonomy\Git\ReferenceBag | Returns the reference list associated to the repository. | |
getRevision ( string $name ) : Gitonomy\Git\Revision | Instanciates a revision. | |
getSize ( ) : integer | Returns the size of repository, in kilobytes. | |
getTree ( string $hash ) : Gitonomy\Git\Tree | Instanciates a tree object or fetches one from the cache. | |
getWorkingCopy ( ) : Gitonomy\Git\WorkingCopy | ||
getWorkingDir ( ) : string | Returns the work-tree directory. This may be null if repository is bare. | |
hasDescription ( ) : boolean | Tests if repository has a custom set description. | |
isBare ( ) : boolean | Tests if repository is a bare repository. | |
isHeadAttached ( ) : boolean | ||
isHeadDetached ( ) : boolean | ||
run ( string $command, array $args = [] ) : string | This command is a facility command. You can run any command directly on git repository. | |
setDescription ( $description ) : |
Changes the repository description (file description in git-directory). | |
setLogger ( Psr\Log\LoggerInterface $logger ) : |
Set repository logger. | |
shell ( string $command, array $env = [] ) | Executes a shell command on the repository, using PHP pipes. |
Method | Description | |
---|---|---|
getProcess ( $command, $args = [] ) | This internal method is used to create a process object. | |
initDir ( string $gitDir, string $workingDir = null ) | Initializes directory attributes on repository:. |
public __construct ( string $dir, array $options = [] ) | ||
$dir | string | path to git repository |
$options | array | array of options values |
public cloneTo ( string $path, boolean $bare = true, array $options = [] ) : |
||
$path | string | path to the new repository in which current repository will be cloned |
$bare | boolean | flag indicating if repository is bare or has a working-copy |
$options | array | |
return | the newly created repository |
public getDescription ( ) : string | ||
return | string | The description |
public getDiff ( $revisions ) : Gitonomy\Git\Diff\Diff | ||
return | Gitonomy\Git\Diff\Diff |
public getHeadCommit ( ) : Gitonomy\Git\Commit | null | ||
return | Gitonomy\Git\Commit | null | returns a Commit or ``null`` if repository is empty |
public getHooks ( ) : Gitonomy\Git\Hooks | ||
return | Gitonomy\Git\Hooks |
public getLog ( array $revisions = null, array $paths = null, integer $offset = null, integer $limit = null ) : Gitonomy\Git\Log | ||
$revisions | array | An array of revisions to show logs from. Can be any text value type |
$paths | array | Restrict log to modifications occurring on given paths. |
$offset | integer | Start from a given offset in results. |
$limit | integer | Limit number of total results. |
return | Gitonomy\Git\Log |
public getLogger ( ) : Psr\Log\LoggerInterface | ||
return | Psr\Log\LoggerInterface | the logger or null |
public getReferences ( ) : Gitonomy\Git\ReferenceBag | ||
return | Gitonomy\Git\ReferenceBag |
public getRevision ( string $name ) : Gitonomy\Git\Revision | ||
$name | string | Name of the revision |
return | Gitonomy\Git\Revision |
public getWorkingCopy ( ) : Gitonomy\Git\WorkingCopy | ||
return | Gitonomy\Git\WorkingCopy |
public getWorkingDir ( ) : string | ||
return | string | path to repository or null if repository is bare |
public hasDescription ( ) : boolean | ||
return | boolean |
public setDescription ( $description ) : |
||
return | the current repository |
public setLogger ( Psr\Log\LoggerInterface $logger ) : |
||
$logger | Psr\Log\LoggerInterface | A logger |
return | The current repository |
protected bool $debug | ||
return | boolean |
protected array $environmentVariables | ||
return | array |
protected string $gitDir | ||
return | string |
protected LoggerInterface,Psr\Log $logger | ||
return | Psr\Log\LoggerInterface |
protected array $objects | ||
return | array |
protected int $processTimeout | ||
return | integer |
protected ReferenceBag,Gitonomy\Git $referenceBag | ||
return | Gitonomy\Git\ReferenceBag |