(PECL svn >= 0.2.0)
svn_import — Imports an unversioned path into a repository
$path
, string $url
, bool $nonrecursive
): bool
Commits unversioned path
into repository at
url
. If path
is a
directory and nonrecursive
is false
,
the directory will be imported recursively.
path
Path of file or directory to import.
注意: 相對路徑將會(huì )以PHP執行文件所在目錄作為當前工作目錄進(jìn)行解析。如果希望依據腳本所在目錄解析, 使用realpath() 或 dirname(__FILE__)。
url
Repository URL to import into.
nonrecursive
Whether or not to refrain from recursively processing directories.
成功時(shí)返回 true
, 或者在失敗時(shí)返回 false
。
示例 #1 Basic example
This example demonstrates a basic use-case of this function. To import a directory named new-files into the repository at http://www.example.com/svnroot/incoming/abc, use:
<?php
svn_import(realpath('new-files'), 'http://www.example.com/svnroot/incoming/abc', false);
?>
此函數是實(shí)驗性的。此函數的表象,包括名稱(chēng)及其相關(guān)文檔都可能在未來(lái)的 PHP 發(fā)布版本中未通知就被修改。使用本函數風(fēng)險自擔。