Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Esempio n. 1
0
 /**
  * TODO
  */
 public function getFile($filename, $opts = array())
 {
     $filename = ltrim($filename, '/');
     $fname = $filename . ',v';
     if (!@is_file($this->sourceroot . '/' . $fname)) {
         throw new Horde_Vcs_Exception(sprintf('File "%s" not found', $filename));
     }
     return parent::getFile($fname, $opts);
 }
Esempio n. 2
0
 /**
  * Constructor.
  *
  * @param array $params  Required parameters (see above).
  */
 public function __construct($params = array())
 {
     if (!empty($params['username'])) {
         $this->_username = $params['username'];
     }
     if (!empty($params['password'])) {
         $this->_password = $params['password'];
     }
     parent::__construct($params);
 }
Esempio n. 3
0
File: Cvs.php Progetto: horde/horde
 /**
  * TODO
  */
 public function getFile($filename, $opts = array())
 {
     $filename = ltrim($filename, '/');
     $fname = $filename . ',v';
     /* Assume file is in the Attic if it doesn't exist. */
     if (!@is_file($this->sourceroot . '/' . $fname)) {
         $fname = dirname($filename) . '/Attic/' . basename($filename) . ',v';
     }
     if (!@is_file($this->sourceroot . '/' . $fname)) {
         throw new Horde_Vcs_Exception(sprintf('File "%s" not found', $filename));
     }
     return Horde_Vcs_Base::getFile($fname, $opts);
 }
Esempio n. 4
0
 /**
  * @throws Horde_Vcs_Exception
  */
 public function __construct($params = array())
 {
     parent::__construct($params);
     if (!is_executable($this->getPath('git'))) {
         throw new Horde_Vcs_Exception('Missing git binary (' . $this->getPath('git') . ' is missing or not executable)');
     }
     $v = trim(shell_exec($this->getPath('git') . ' --version'));
     $this->version = preg_replace('/[^\\d\\.]/', '', $v);
     // Try to find the repository if we don't have the exact path. @TODO put
     // this into a builder method/object and cache the results.
     if (!file_exists($this->sourceroot . '/HEAD')) {
         if (file_exists($this->sourceroot . '.git/HEAD')) {
             $this->_sourceroot .= '.git';
         } elseif (file_exists($this->sourceroot . '/.git/HEAD')) {
             $this->_sourceroot .= '/.git';
         } else {
             throw new Horde_Vcs_Exception('Can not find git repository.');
         }
     }
 }
Esempio n. 5
0
 /**
  * Sort function for ascending revision.
  */
 public function _fileRevSort($a, $b)
 {
     return $this->_rep->cmp($a->getRevision(), $b->getRevision());
 }