/**
  * Initialize executable
  *
  * @param boolean $validate whether the exe should be validated
  */
 protected function InitializeGitExe($validate = true)
 {
     $this->exe = new GitPHP_GitExe($this->config->GetValue('gitbin'));
     if ($this->log) {
         $this->exe->AddObserver($this->log);
     }
     if ($validate && !$this->exe->Valid()) {
         throw new GitPHP_InvalidGitExecutableException($this->exe->GetBinary());
     }
 }
示例#2
0
 }
 /*
  * Debug
  */
 if (GitPHP_Log::GetInstance()->GetEnabled()) {
     GitPHP_Log::GetInstance()->SetStartTime(GITPHP_START_TIME);
     GitPHP_Log::GetInstance()->SetStartMemory(GITPHP_START_MEM);
 }
 if (!GitPHP_Config::GetInstance()->GetValue('projectroot', null)) {
     throw new GitPHP_MessageException(__('A projectroot must be set in the config'), true, 500);
 }
 /*
  * Check for required executables
  */
 $exe = new GitPHP_GitExe(null);
 if (!$exe->Valid()) {
     throw new GitPHP_MessageException(sprintf(__('Could not run the git executable "%1$s".  You may need to set the "%2$s" config value.'), $exe->GetBinary(), 'gitbin'), true, 500);
 }
 if (!function_exists('xdiff_string_diff')) {
     $exe = new GitPHP_DiffExe();
     /*
     		if (!$exe->Valid()) {
     			throw new GitPHP_MessageException(sprintf(__('Could not run the diff executable "%1$s".  You may need to set the "%2$s" config value.'), $exe->GetBinary(), 'diffbin'), true, 500);
     		}*/
 }
 unset($exe);
 /*
  * Authentification
  */
 $auth = new GitPHP_Authentication();
 $auth->authenticate();