本文整理汇总了PHP中Repository::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::run方法的具体用法?PHP Repository::run怎么用?PHP Repository::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
/**
* Returns content of the blob.
*
* @throws ProcessException Error occurred while getting content of blob
*/
public function getContent()
{
if (null === $this->content) {
$this->content = $this->repository->run('cat-file', array('-p', $this->hash));
}
return $this->content;
}
示例2: getFiles
/**
* Returns array of files whit diff informations.
*
* @param array $args Additional arguments for log command.
* @param type $asArray Returns array if TRUE, instance of Generator otherwise,
* @return array|Generator
*/
public function getFiles(array $args = [], $asArray = false)
{
$args[] = $this->getCommitHashFrom();
$args[] = $this->getCommitHashTo();
$diffRaw = $this->repository->run('diff', $args);
if ($asArray) {
$data = [];
foreach ($this->parser->parse($diffRaw->getOutput()) as $file) {
$data[] = $file;
}
return $data;
}
return $this->parser->parse($diffRaw->getOutput());
}
示例3: getParserOutput
/**
* Prepare and run process for log command and returns instance of LogParser.
*
* @param array $args Additional arguments for log command.
* @return LogParser
*/
protected function getParserOutput(array $args = [])
{
$logArgs = array_merge(['--numstat', '--summary', '--pretty=format:COMMITSTART%H%n%h%n%P%n%aN%n%ae%n%ct%n%s%n%b%nENDOFOUTPUTGITMESSAGE'], $args);
return $this->repository->run('log', $logArgs)->getOutput();
}