当前位置: 首页>>代码示例>>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;未经允许,请勿转载。