Constants |
public Gitonomy |
Methods |
public __construct( $dir, $options = []) Constructs a new repository. Available options are:
|
public cloneTo( $path, $bare = true, array $options = []) Clones the current repository to a new directory and return instance of new repository.
|
public getBlame( $revision, $file, $lineRange = NULL)
|
public getBlob( $hash) Instanciates a blob object or fetches one from the cache.
|
public getCommit( $hash) Instanciates a commit object or fetches one from the cache.
|
public getDescription() Returns description of repository from description file in git directory.
|
public getDiff( $revisions)
|
public getGitDir() Returns the directory containing git files (git-dir).
|
public getHead()
|
public getHeadCommit() Returns the HEAD resolved as a commit.
|
public getHooks() Returns the hooks object.
|
public getLog( $revisions = NULL, $paths = NULL, $offset = NULL, $limit = NULL) Returns log for a given set of revisions and paths. All those values can be null, meaning everything.
|
public getLogger() Returns repository logger.
|
public getPath() Returns the path to the git repository.
|
public getReferences( $reload = false) Returns the reference list associated to the repository.
|
public getRevision( $name) Instanciates a revision.
|
public getSize() Returns the size of repository, in kilobytes.
|
public getTree( $hash) Instanciates a tree object or fetches one from the cache.
|
public getWorkingCopy()
|
public getWorkingDir() Returns the work-tree directory. This may be null if repository is bare.
|
public hasDescription() Tests if repository has a custom set description.
|
public isBare() Tests if repository is a bare repository.
|
public isHeadAttached()
|
public isHeadDetached()
|
public run( $command, $args = []) This command is a facility command. You can run any command directly on git repository.
|
public setDescription( $description) Changes the repository description (file description in git-directory).
|
public setLogger(Psr\Log\LoggerInterface $logger) Set repository logger.
|
public shell( $command, array $env = []) Executes a shell command on the repository, using PHP pipes.
|
Properties |
protected $command = NULL Path to git command. |
protected $debug = NULL Debug flag, indicating if errors should be thrown.
|
protected $environmentVariables = NULL Environment variables that should be set for every running process.
|
protected $gitDir = NULL Directory containing git files.
|
protected $inheritEnvironmentVariables = NULL
|
protected $logger = NULL Logger (can be null).
|
protected $objects = NULL Cache containing all objects of the repository. Associative array, indexed by object hash
|
protected $processTimeout = NULL Timeout that should be set for every running process.
|
protected $referenceBag = NULL Reference bag associated to this repository.
|
protected $workingDir = NULL Working directory.
|
Methods |
private getProcess( $command, $args = []) This internal method is used to create a process object. Made private to be sure that process creation is handled through the run method. run method ensures logging and debug.
|
private initDir( $gitDir, $workingDir = NULL) Initializes directory attributes on repository:.
|