array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.svn-update.php', 1 => 'svn_update', ), 'up' => array ( 0 => 'ref.svn.php', 1 => 'SVN 函数', ), 'prev' => array ( 0 => 'function.svn-status.php', 1 => 'svn_status', ), 'next' => array ( 0 => 'book.tcpwrap.php', 1 => 'TCP', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/svn/functions/svn-update.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL svn >= 0.1.0)
svn_update — Update working copy
Update working copy at path
to revision
revno
. If recurse
is true,
directories will be recursively updated.
path
Path to local working copy.
注意: 相对路径将会以PHP执行文件所在目录作为当前工作目录进行解析。如果希望依据脚本所在目录解析, 使用realpath() 或 dirname(__FILE__)。
revno
Revision number to update to, default is SVN_REVISION_HEAD
.
recurse
Whether or not to recursively update directories.
Returns new revision number on success, returns false
on failure.
示例 #1 Basic example
This example demonstrates basic usage of this function:
<?php
echo svn_update(realpath('working-copy'));
?>
以上示例的输出类似于:
234
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担。