Class: VersionControl_SVN_Export
Source Location: /VersionControl_SVN-0.3.2/SVN/Export.php
VersionControl_SVN
|
--VersionControl_SVN_Export
Subversion Export command manager class
Author(s):
Version:
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
[line 171]
Subversion Export command manager class Create an unversioned copy of a tree. From 'svn export --help': usage: 1. export [-r REV] URL [PATH] 2. export [-r REV] PATH1 [PATH2] - Exports a clean directory tree from the repository specified by
URL, at revision REV if it is given, otherwise at HEAD, into
PATH. If PATH is omitted, the last component of the URL is used
for the local directory name.
2. Exports a clean directory tree from the working copy specified by PATH1, at revision REV if it is given, otherwise at WORKING, into PATH2. If PATH2 is omitted, the last component of the PATH1 is used for the local directory name. If REV is not specified, all local changes will be preserved, but files not under version control will not be copied. Conversion of the above usage examples to VersionControl_SVN_Export: Example 1: <?php
require_once 'VersionControl/SVN.php';
// Setup error handling -- always a good idea!
$svnstack = &PEAR_ErrorStack::singleton('VersionControl_SVN');
// Set up runtime options. Will be passed to all
// subclasses.
$switches = array('r' => 'HEAD');
$args = array('svn://svn.example.com/repos/TestProj/trunk',
'/my/export/path/Test-Project-1.0');
$svn->export ->run($args,$switches));
if (count($errs = $svnstack->getErrors ())) {
foreach ($errs as $err) {
echo '<br />'.$err['message']."<br />\n";
echo "Command used: " . $err['params']['cmd'];
}
}
?>
Example 2: <?php
require_once 'VersionControl/SVN.php';
// Setup error handling -- always a good idea!
$svnstack = &PEAR_ErrorStack::singleton('VersionControl_SVN');
// Set up runtime options. Will be passed to all
// subclasses.
$args = array('/repos/TestProj/trunk',
'/my/export/path/Test-Project-1.0');
$svn->export ->run($args);
if (count($errs = $svnstack->getErrors ())) {
foreach ($errs as $err) {
echo '<br />'.$err['message']."<br />\n";
echo "Command used: " . $err['params']['cmd'];
}
}
?>
$switches is an array containing one or more command line options defined by the following associative keys: $switches = array(
'r [revision]' => 'ARG (some commands also take ARG1:ARG2 range)
A revision argument can be one of:
NUMBER revision number
"{" DATE "}" revision at start of the date
"HEAD" latest in repository
"BASE" base rev of item's working copy
"COMMITTED" last commit at or before BASE
"PREV" revision just before COMMITTED',
// either 'r' or 'revision' may be used
'q [quiet]' => true|false,
// prints as little as possible
'force' => true|false,
// force operation to run
'username' => 'Subversion repository login',
'password' => 'Subversion repository password',
'no-auth-cache' => true|false,
// Do not cache authentication tokens
'config- dir' => 'Path to a Subversion configuration directory
);
Note: Subversion does not offer an XML output option for this subcommand The non-interactive option available on the command-line svn client may also be set (true|false), but it is set to true by default.
Class Variables
Method Detail
Documentation generated on Sun, 09 Aug 2009 21:30:07 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.
|
|