Пример #1
0
 /**
  * Get repository from directory.
  * Throws RepositoryException if repository not found at dir.
  *
  * @param string $dir project path (not a path to .git or .hg!)
  * @param BaseWrapper $wrapper
  * @throws CommonException
  */
 public function __construct($dir, BaseWrapper $wrapper)
 {
     $projectPath = FileHelper::normalizePath(realpath($dir));
     $repositoryPath = FileHelper::normalizePath($projectPath . '/' . $wrapper->getRepositoryPathName());
     if (!is_dir($repositoryPath)) {
         throw new CommonException('Repository not found at ' . $dir);
     }
     $this->projectPath = $projectPath;
     $this->repositoryPath = $repositoryPath;
     $this->wrapper = $wrapper;
     $this->checkRepository();
     parent::__construct([]);
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function buildCommand($params)
 {
     // prepend postfix --no-pager for all commands
     if (is_scalar($params)) {
         $params = '--no-pager ' . $params;
     } elseif (is_array($params)) {
         $params = \yii\helpers\ArrayHelper::merge(['--no-pager'], $params);
     }
     return parent::buildCommand($params);
 }