當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Git::config方法代碼示例

本文整理匯總了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();
 }
開發者ID:Theaxiom,項目名稱:chaw-source,代碼行數:31,代碼來源:git.test.php

示例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);
開發者ID:reveliant,項目名稱:dirty-ci,代碼行數:31,代碼來源:index.php


注:本文中的Git::config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。