svn_checkout

(PECL svn >= 0.1.0)

svn_checkoutChecks out a working copy from the repository

說明

svn_checkout(
    string $repos,
    string $targetpath,
    int $revision = ?,
    int $flags = 0
): bool

Checks out a working copy from the repository at repos to targetpath at revision revision.

參數(shù)

repos

String URL path to directory in repository to check out.

targetpath

String local path to directory to check out in to

注意: 相對路徑將會以PHP執(zhí)行文件所在目錄作為當前工作目錄進行解析。如果希望依據(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.

返回值

成功時返回 true, 或者在失敗時返回 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ù)的表象,包括名稱及其相關文檔都可能在未來的 PHP 發(fā)布版本中未通知就被修改。使用本函數(shù)風險自擔。

參見