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


PHP Git::get_bin方法代碼示例

本文整理匯總了PHP中Git::get_bin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Git::get_bin方法的具體用法?PHP Git::get_bin怎麽用?PHP Git::get_bin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Git的用法示例。


在下文中一共展示了Git::get_bin方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initRepo

 private function initRepo()
 {
     //get path to the repo root (by default DokuWiki's savedir)
     if (defined('DOKU_FARM')) {
         $repoPath = $this->getConf('repoPath');
     } else {
         $repoPath = DOKU_INC . $this->getConf('repoPath');
     }
     //set the path to the git binary
     $gitPath = trim($this->getConf('gitPath'));
     if ($gitPath !== '') {
         Git::set_bin($gitPath);
     }
     //init the repo and create a new one if it is not present
     io_mkdir_p($repoPath);
     $repo = new GitRepo($repoPath, true, true);
     //set git working directory (by default DokuWiki's savedir)
     $repoWorkDir = DOKU_INC . $this->getConf('repoWorkDir');
     Git::set_bin(Git::get_bin() . ' --work-tree ' . escapeshellarg($repoWorkDir));
     $params = str_replace(array('%mail%', '%user%'), array($this->getAuthorMail(), $this->getAuthor()), $this->getConf('addParams'));
     if ($params) {
         Git::set_bin(Git::get_bin() . ' ' . $params);
     }
     return $repo;
 }
開發者ID:MarcinKlejna,項目名稱:dokuwiki-plugin-gitbacked,代碼行數:25,代碼來源:editcommit.php

示例2: initRepo

 private function initRepo()
 {
     if (!class_exists("Git")) {
         require 'Git.php/Git.php';
     }
     $this->pullOnChange = c::get('gcapc-pull', false);
     $this->pushOnChange = c::get('gcapc-push', false);
     $this->commitOnChange = c::get('gcapc-commit', false);
     $this->gitBin = c::get('gcapc-gitBin', '');
     $this->windowsMode = c::get('gcapc-windowsMode', false);
     if ($this->windowsMode) {
         Git::windows_mode();
     }
     if ($this->gitBin) {
         Git::set_bin($this->gitBin);
     }
     $this->repo = Git::open($this->repoPath);
     if (!$this->repo->test_git()) {
         trigger_error('git could not be found or is not working properly. ' . Git::get_bin());
     }
 }
開發者ID:blankogmbh,項目名稱:kirby-git-commit-and-push-content,代碼行數:21,代碼來源:helpers.php

示例3: run

 /**
  * Run a git command in the git repository
  *
  * Accepts a git command to run
  *
  * @access  public
  * @param   string  command to run
  * @return  string
  */
 public function run($command)
 {
     return $this->run_command(Git::get_bin() . ' ' . $command);
 }
開發者ID:KingNoosh,項目名稱:Teknik,代碼行數:13,代碼來源:Git.php

示例4: test

 /**
  * Tests if git is installed
  *
  * @access  public
  * @return  bool
  */
 public function test()
 {
     $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
     $pipes = array();
     $resource = proc_open(Git::get_bin(), $descriptorspec, $pipes);
     $stdout = stream_get_contents($pipes[1]);
     $stderr = stream_get_contents($pipes[2]);
     foreach ($pipes as $pipe) {
         fclose($pipe);
     }
     $status = trim(proc_close($resource));
     return $status != 127;
 }
開發者ID:iwalpola,項目名稱:git,代碼行數:19,代碼來源:Git.php


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