public function getObjectInfo($path, $ref = 'HEAD')
{
/** @var $result CallResult */
$result = $this->getSvn()->{'info'}($this->getRepositoryPath(), array('--xml', '--revision' => $ref, $this->resolveLocalPath($path)));
$result->assertSuccess(sprintf('Cannot get info for "%s" at "%s" from "%s"', $path, $ref, $this->getRepositoryPath()));
$xml = simplexml_load_string($result->getStdOut());
if (!$xml) {
throw new \RuntimeException(sprintf('Cannot read info XML for "%s" at "%s" from "%s"', $path, $ref, $this->getRepositoryPath()));
}
$entry = $xml->xpath('/info/entry');
if (count($entry) !== 1) {
throw new \RuntimeException(sprintf('Cannot read info XML for "%s" at "%s" from "%s"', $path, $ref, $this->getRepositoryPath()));
}
$entry = reset($entry);
$mode = 0;
switch ((string) $entry['kind']) {
case 'dir':
$mode |= 040000;
break;
case 'file':
$mode |= 0100000;
break;
}
return array('type' => (string) $entry['kind'], 'mode' => (int) $mode, 'size' => 0);
}