TQ\Svn\Repository\Repository::listDirectory PHP Method

listDirectory() public method

List the directory at a given version
public listDirectory ( string $directory = '.', string $ref = 'HEAD' ) : array
$directory string The path ot the directory
$ref string The version ref
return array
    public function listDirectory($directory = '.', $ref = 'HEAD')
    {
        $directory = FileSystem::normalizeDirectorySeparator($directory);
        $directory = rtrim($directory, '/') . '/';
        $args = array('--xml', '--revision' => $ref, $this->resolveLocalPath($directory));
        /** @var $result CallResult */
        $result = $this->getSvn()->{'list'}($this->getRepositoryPath(), $args);
        $result->assertSuccess(sprintf('Cannot list directory "%s" at "%s" from "%s"', $directory, $ref, $this->getRepositoryPath()));
        $xml = simplexml_load_string($result->getStdOut());
        if (!$xml) {
            throw new \RuntimeException(sprintf('Cannot read list XML for "%s" at "%s" from "%s"', $directory, $ref, $this->getRepositoryPath()));
        }
        $list = array();
        foreach ($xml->xpath('/lists/list/entry') as $item) {
            $list[] = (string) $item->name;
        }
        return $list;
    }