svn_ls

(PECL svn >= 0.1.0)

svn_lsReturns list of directory contents in repository URL, optionally at revision number

说明

svn_ls ( string $repos_url [, int $revision_no = SVN_REVISION_HEAD [, bool $recurse = FALSE [, bool $peg = FALSE ]]] ) : array

This function queries the repository URL and returns a list of files and directories, optionally from a specific revision. This is equivalent to svn list $repos_url[@$revision_no]

Note:

This function does not work with working copies. repos_url must be a repository URL.

参数

url

URL of the repository, eg. http://www.example.com/svnroot. To access a local Subversion repository via filesystem, use the file URI scheme, eg. file:///home/user/svn-repos

revision

Integer revision number to retrieve listing of. When omitted, the HEAD revision is used.

recurse

Enables recursion.

返回值

On success, this function returns an array file listing in the format of:

[0] => Array
    (
        [created_rev] => integer revision number of last edit
        [last_author] => string author name of last edit
        [size] => integer byte file size of file
        [time] => string date of last edit in form 'M d H:i'
                  or 'M d Y', depending on how old the file is
        [time_t] => integer unix timestamp of last edit
        [name] => name of file/directory
        [type] => type, can be 'file' or 'dir'
    )
[1] => ...

注释

Warning

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

范例

Example #1 svn_ls() example

<?php
print_r
svn_ls('http://www.example.com/svnroot/') );
?>

以上例程的输出类似于:

Array
(
    [0] => Array
        (
            [created_rev] => 20
            [last_author] => Joe
            [size] => 0
            [time] => Apr 02 09:28
            [time_t] => 1175520529
            [name] => tags
            [type] => dir
        )
    [1] => Array
        (
            [created_rev] => 23
            [last_author] => Bob
            [size] => 0
            [time] => Apr 02 15:15
            [time_t] => 1175541322
            [name] => trunk
            [type] => dir
        )
)

相关文章
php ftp 函数 returns a list of files in the given directoryphp informix 函数 returns the number of columns in the queryphp postgresql 函数 returns the type id oid for the corresponding field numberphp svn 函数 returns the contents of a file in a repositoryphp svn 函数 export the contents of a svn directoryphp svn 函数 determines what kind of item lives at path in a given repository fsrootphp svn 函数 copies a file or a directory returns true if all is ok false otherwisephp svn 函数 enumerates the directory entries under path; returns a hash of dir names to file typephp svn 函数 returns a stream to access the contents of a file from a given version of the fsphp svn 函数 creates a new empty directory returns true if all is ok false otherwisephp svn 函数 returns the revision in which path under fsroot was createdphp svn 函数 returns the number of the youngest revision in the filesystemphp svn 函数 returns the commit log messages of a repository urlphp svn 函数 returns list of directory contents in repository url optionally at revision numberphp svn 函数 creates a directory in a working copy or repositoryphp svn 函数 create a new subversion repository at pathphp svn 函数 commits a transaction and returns the new revisionphp svn 函数 run recovery procedures on the repository located at pathphp svn 函数 returns the status of working copy files and directoriesphp tidy 函数 returns the number of tidy accessibility warnings encountered for specified document
关注编程学问公众号