(PECL svn >= 0.1.0)
svn_checkout — Checks out a working copy from the repository
$repos,$targetpath,$revision = ?,$flags = 0
Checks out a working copy from the repository at repos
to targetpath at revision revision.
reposString URL path to directory in repository to check out.
targetpathString local path to directory to check out in to
注意: 相對路徑將會(huì )以PHP執行文件所在目錄作為當前工作目錄進(jìn)行解析。如果希望依據腳本所在目錄解析, 使用realpath() 或 dirname(__FILE__)。
revisionInteger revision number of repository to check out. Default is HEAD, the most recent revision.
flags
Any combination of SVN_NON_RECURSIVE and
SVN_IGNORE_EXTERNALS.
成功時(shí)返回 true, 或者在失敗時(shí)返回 false。
示例 #1 Basic example
This example demonstrates how to check out a directory from a repository to a directory named calc:
<?php
svn_checkout('http://www.example.com/svnroot/calc/trunk', dirname(__FILE__) . '/calc');
?>
The dirname(__FILE__) call is necessary in order
to convert the calc relative path into an absolute one. If calc
exists, you can also use realpath() to retrieve
an absolute path.
此函數是實(shí)驗性的。此函數的表象,包括名稱(chēng)及其相關(guān)文檔都可能在未來(lái)的 PHP 發(fā)布版本中未通知就被修改。使用本函數風(fēng)險自擔。