note 102315 added to function.svn-fs-dir-entries

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Here is a function that returns an array with the directories in the root of the HEAD revision of a repository, using only the path of the repository.
<?php
    function get_repo_dirs($path){
        if (file_exists($path.'/format'))
        if ($repo = svn_repos_open($path))
        if ($repo_fs = svn_repos_fs($repo))
        if ($head = svn_fs_youngest_rev($repo_fs))
        if ($repo_fs_root = svn_fs_revision_root($repo_fs,$head))
        return array_keys(svn_fs_dir_entries($repo_fs_root,'.'));
        else return false;
    }
?>

example usage

<?php
    var_dump (get_repo_dirs('/home/user/svnrepos/example_project'));
?>
----
Server IP: 69.147.83.197
Probable Submitter: 212.205.95.95
----
Manual Page -- http://www.php.net/manual/en/function.svn-fs-dir-entries.php
Edit        -- https://master.php.net/note/edit/102315
Del: integrated  -- https://master.php.net/note/delete/102315/integrated
Del: useless     -- https://master.php.net/note/delete/102315/useless
Del: bad code    -- https://master.php.net/note/delete/102315/bad+code
Del: spam        -- https://master.php.net/note/delete/102315/spam
Del: non-english -- https://master.php.net/note/delete/102315/non-english
Del: in docs     -- https://master.php.net/note/delete/102315/in+docs
Del: other reasons-- https://master.php.net/note/delete/102315
Reject      -- https://master.php.net/note/reject/102315
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.