Forum und email

svn_checkout

(PECL svn:0.1-0.2)

svn_checkout — Checks out a working copy from the repository

설명

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

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

Note: 상대 경로는 PHP 바이너리가 있는 디렉토리를 현재 작업 디렉토리로 인식합니다. 스크립트의 작업 디렉토리를 얻으려면, realpath()나 dirname(__FILE__)을 사용하십시오.

revision

Integer revision number of repository to check out. Default is HEAD, the most recent revision.

반환값

성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.

주의

Warning

This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

예제

Example#1 Basic example

This example demonstrates how to check out a directory from a repository to a directory named calc:

<?php
svn_checkout
('https://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.