downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

svn_cleanup> <svn_cat
Last updated: Fri, 13 Nov 2009

view this page in

svn_checkout

(PECL svn >= 0.1.0)

svn_checkoutリポジトリから作業コピーをチェックアウトする

説明

bool svn_checkout ( string $repos , string $targetpath [, int $revision [, int $flags = 0 ]] )

repos にあるリポジトリの リビジョン revision を、 targetpath の作業コピーにチェックアウトします。

パラメータ

repos

チェックアウトしたいリポジトリ内のディレクトリを表す URL 文字列。

targetpath

チェックアウト先ディレクトリのローカルパス。

注意: 相対パスは、PHP バイナリが存在するディレクトリを基準として解決されます。呼び出しもとのスクリプトの作業ディレクトリを基準とするには、realpath() あるいは dirname(__FILE__) を使用してください。

revision

チェックアウトしたいリビジョン番号を表す整数値。デフォルトは HEAD リビジョンで、これは最新のリビジョンを表します。

flags

SVN_NON_RECURSIVE および SVN_IGNORE_EXTERNALS の任意の組み合わせ。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

注意

警告

この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。

例1 基本的な例

この例は、リポジトリ内のディレクトリを calc という名前のローカルディレクトリにチェックアウトします。

<?php
svn_checkout
('http://www.example.com/svnroot/calc/trunk'dirname(__FILE__) . '/calc');
?>

dirname(__FILE__) を使用して、 相対パス calc を絶対パスに変換する必要があります。 もし calc ディレクトリが存在するのなら、 realpath() を使って絶対パスを取得することもできます。

参考



add a note add a note User Contributed Notes
svn_checkout
Anonymous
14-Apr-2008 08:08
The current version of svn does not seem to indicate an error properly when passed an invalid string, so it's important to check your paths and to clean them before calling svn or it will just not work.

Under Windows getting the format correctly is a bit tricky, so here's the format it wants:

file:///c:/path/to/repos

Note the following:
1) The extra slash after the protocol designates 'root' under Unix (file:///path/to/repos points to /path/to/repos in Unix), but it seems to have no real meaning in the string on Windows (?).

2) Paths are usually reported with backslashes, so you'll need to replace those with slashes manually before handing them off to Subversion.

svn_cleanup> <svn_cat
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites