略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: svn_fs_dir_entries

2024-03-28

svn_fs_dir_entries

(PECL svn >= 0.1.0)

svn_fs_dir_entriesEnumerates the directory entries under path; returns a hash of dir names to file type

说明

svn_fs_dir_entries(resource $fsroot, string $path): array
警告

本函数还未编写文档,仅有参数列表。

Enumerates the directory entries under path; returns a hash of dir names to file type

注释

警告

此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。

add a noteadd a note

User Contributed Notes 1 note

up
0
qwazix at outofbounds dot gr
11 years ago
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'));
?>

官方地址:https://www.php.net/manual/en/function.svn-fs-dir-entries.php

冷却塔厂家 广告
-- 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3