(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
.
repos
String URL path to directory in repository to check out.
targetpath
String local path to directory to check out in to
注意: 相對路徑將會(huì)以PHP執(zhí)行文件所在目錄作為當(dāng)前工作目錄進(jìn)行解析。如果希望依據(jù)腳本所在目錄解析, 使用realpath() 或 dirname(__FILE__)。
revision
Integer 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ù)是實(shí)驗(yàn)性的。此函數(shù)的表象,包括名稱及其相關(guān)文檔都可能在未來的 PHP 發(fā)布版本中未通知就被修改。使用本函數(shù)風(fēng)險(xiǎn)自擔(dān)。