本文整理汇总了PHP中Git::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Git::config方法的具体用法?PHP Git::config怎么用?PHP Git::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Git
的用法示例。
在下文中一共展示了Git::config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFork
function testFork()
{
$Git = new Git($this->__repos[1]);
$this->assertTrue($Git->create());
$File = new File(TMP . 'tests/git/working/test/master/.gitignore');
$this->assertTrue($File->write('this is something new'));
$Git->commit('Updating git ignore');
$Git->push();
$File = new File(TMP . 'tests/git/working/test/master/new_file.txt', true, 0777);
$this->assertTrue($File->write('this is something new'));
$Git->commit('Adding new file');
$Git->push();
$Git->logResponse = true;
$result = $Git->fork("gwoo");
$this->assertTrue(file_exists(TMP . 'tests/git/repo/forks/gwoo/test.git'));
$this->assertTrue(file_exists(TMP . 'tests/git/working/forks/gwoo/test/master/'));
$result = $Git->find('all');
$this->assertEqual($result[0]['Repo']['message'], 'Adding new file');
$this->assertEqual($result[1]['Repo']['message'], 'Updating git ignore');
$Git->config($this->__repos[1]);
$Git->branch = null;
$result = $Git->fork("bob");
$this->assertTrue(file_exists(TMP . 'tests/git/repo/forks/bob/test.git'));
$this->assertTrue(file_exists(TMP . 'tests/git/working/forks/bob/test/master/'));
$result = $Git->find('all');
$this->assertEqual($result[0]['Repo']['message'], 'Adding new file');
$this->assertEqual($result[1]['Repo']['message'], 'Updating git ignore');
// pr($Git->debug);
//pr($Git->response);
//die();
}
示例2: header
}
if ($found) {
header('HTTP/1.1 204 No Content');
} else {
header('HTTP/1.1 202 Accepted');
Log::event('Received a pull webhook for an unhandled project');
Log::client('This repository may not be synchronized');
}
return $found;
}
}
Log::open($log);
$input = json_decode(file_get_contents('php://input'));
$conf = json_decode(file_get_contents($config));
if (isset($conf->git) && isset($conf->repositories)) {
Git::config($conf->git);
Git::repositories($conf->repositories);
} else {
header('HTTP/1.1 500 Internal Server Error');
Log::event('Malformed configuration');
exit(1);
}
if (array_key_exists('HTTP_X_GITHUB_EVENT', $_SERVER) && isset($input->repository->ssh_url)) {
// GitHub
if ($_SERVER['HTTP_X_GITHUB_EVENT'] == 'push') {
if (!Git::search($input->repository->ssh_url)) {
Log::struct($input);
}
} else {
Log::event('Received a GitHub webhook of unhandled kind (' . $_SERVER['HTTP_X_GITHUB_EVENT'] . ')');
Log::struct($input);