本文整理汇总了PHP中Git::exec方法的典型用法代码示例。如果您正苦于以下问题:PHP Git::exec方法的具体用法?PHP Git::exec怎么用?PHP Git::exec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Git
的用法示例。
在下文中一共展示了Git::exec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postDeploy
/**
* Execute post commands.
*
* @var array
*/
public function postDeploy(array $commands)
{
foreach ($commands as $command) {
$this->cli->out("Execute : <white>{$command}");
$output = $this->git->exec($command);
$output = implode(' ', $output);
$this->cli->out("Result : <white>{$output}");
}
}
示例2: apiDownload
/**
* Entry point for Problem Download API
*
* @param Request $r
* @throws InvalidFilesystemOperationException
* @throws InvalidDatabaseOperationException
*/
public static function apiDownload(Request $r)
{
self::authenticateRequest($r);
// Validate request
self::validateDownload($r);
// Get HEAD revision to avoid race conditions.
$gitDir = PROBLEMS_GIT_PATH . DIRECTORY_SEPARATOR . $r['problem']->alias;
$git = new Git($gitDir);
$head = trim($git->get(array('rev-parse', 'HEAD')));
// Set headers to auto-download file
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Type: application/zip');
header('Content-Disposition: attachment;filename=' . $r['problem']->alias . '_' . $head . '.zip');
header('Content-Transfer-Encoding: binary');
$git->exec(array('archive', '--format=zip', $head));
die;
}