svn_import
(PECL svn >= 0.2.0)
svn_import — Imports an unversioned path into a repository
Description
svn_import ( string $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.
Parameters
-
path
-
Path of file or directory to import.
Note: Relative paths will be resolved as if the current working directory was the one that contains the PHP binary. To use the calling script's working directory, use realpath() or dirname(__FILE__).
-
url
-
Repository URL to import into.
-
nonrecursive
-
Whether or not to refrain from recursively processing directories.
Return Values
Returns true
on success or false
on failure.
Notes
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.
Examples
Example #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); ?>
See Also
- svn_add() - Schedules the addition of an item in a working directory
- » SVN documentation for svn import
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.svn-import.php