Ejemplo n.º 1
0
 /**
  * Short description of method listContent
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @param  Repository vcs
  * @param  string path
  * @param  int revision
  * @return array
  */
 public function listContent(core_kernel_versioning_Repository $vcs, $path, $revision = null)
 {
     $returnValue = array();
     $r = !is_null($revision) ? ' -r ' . $revision : '';
     $xmlStr = core_kernel_versioning_subversionWindows_Utils::exec($vcs, 'list --xml "' . $path . '"' . $r);
     $dom = new DOMDocument();
     @$dom->loadXML($xmlStr);
     $xpath = new DOMXPath($dom);
     $entries = $xpath->query("//entry");
     foreach ($entries as $entry) {
         $returnValue[] = array('name' => $entry->getElementsByTagName('name')->item(0)->nodeValue, 'type' => $entry->getAttribute('kind'), 'revision' => $entry->getElementsByTagName('commit')->item(0)->getAttribute('revision'), 'author' => $entry->getElementsByTagName('commit')->item(0)->getElementsByTagName('author')->item(0)->nodeValue, 'time' => strtotime($entry->getElementsByTagName('commit')->item(0)->getElementsByTagName('date')->item(0)->nodeValue));
     }
     return (array) $returnValue;
 }
Ejemplo n.º 2
0
 /**
  * Short description of method resolve
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @param  File resource
  * @param  string path
  * @param  string version
  * @return boolean
  */
 public function resolve(core_kernel_file_File $resource, $path, $version)
 {
     $returnValue = (bool) false;
     $returnValue = core_kernel_versioning_subversionWindows_Utils::exec($resource, 'resolve --accept ' . $version . ' "' . $path . '"');
     return (bool) $returnValue;
 }