Forum und email

svn_add

(PECL svn:0.1-0.2)

svn_add — Schedules the addition of an item in a working directory

설명

bool svn_add ( string $path [, bool $recursive [, bool $force ]] )

Adds the file, directory or symbolic link at path to the working directory. The item will be added to the repository the next time you call svn_commit() on the working copy.

매개변수

path

Path of item to add.

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

recursive

If item is directory, whether or not to recursively add all of its contents. Default is TRUE

force

If true, Subversion will recurse into already versioned directories in order to add unversioned files that may be hiding in those directories. Default is FALSE

반환값

성공할 경우 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 svn_add() example

In a working directory where svn status returns:

$ svn status
?      foobar.txt

...this code:

<?php
svn_add
('foobar.txt');
?>

...will schedule foobar.txt for addition into the repository.