Beispiel #1
0
 /**
  * Executes svn command and returns output as a SimpleXMLElement object
  *
  * @param string $options Options to provide to svn command
  * @return SimpleXMLElement
  */
 protected function _execute($options)
 {
     $command = 'svn ' . $options . ' --non-interactive --xml';
     VcsStats_Runner_Cli::displayDebug("Executing command '{$command}'");
     exec($command, $output, $returnCode);
     $output = implode('', $output);
     return new SimpleXMLElement($output);
 }
Beispiel #2
0
 /**
  * Updates the cache data
  *
  * @param int|null $endRevisionId Id of the last revision to retrieve
  * @return void
  */
 public function updateData($endRevisionId = null)
 {
     VcsStats_Runner_Cli::displayMessage('Updating cache data');
     $startRevisionId = $this->getLastCachedRevisionId();
     if (null === $startRevisionId) {
         $startRevisionId = 1;
     }
     if ($startRevisionId >= $endRevisionId) {
         VcsStats_Runner_Cli::displayDebug('Everything is already in cache');
         return;
     }
     if (null === $endRevisionId) {
         $endRevisionId = 'HEAD';
     }
     $data = $this->_wrapper->getRevisionsData($startRevisionId, $endRevisionId);
     $this->_populate($data);
 }