VersionControl_SVN
[ class tree: VersionControl_SVN ] [ index: VersionControl_SVN ] [ all elements ]

Class: VersionControl_SVN_Command_Export

Source Location: /VersionControl_SVN-0.5.2/VersionControl/SVN/Command/Export.php

Class Overview

VersionControl_SVN_Command
   |
   --VersionControl_SVN_Command_Export

Subversion Export command manager class


Author(s):

Version:

  • 0.5.2

Copyright:

  • 2004-2007 Clay Loveless

Variables

Methods


Inherited Variables

Inherited Methods

Class: VersionControl_SVN_Command

VersionControl_SVN_Command::__construct()
Constructor. Can't be called directly as class is abstract.
VersionControl_SVN_Command::checkCommandRequirements()
Standardized validation of requirements for a command class.
VersionControl_SVN_Command::fillSwitch()
Fills the switches array on given name with value if not already set and value is not null.
VersionControl_SVN_Command::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Command::postProcessSwitches()
Called after handling switches.
VersionControl_SVN_Command::prepare()
Prepare the command switches.
VersionControl_SVN_Command::preProcessSwitches()
Called before handling switches.
VersionControl_SVN_Command::run()
Run the command with the defined switches.
VersionControl_SVN_Command::setOptions()
Allow for overriding of previously declared options.

Class Details

[line 162]
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]

  1. 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:

  1.  <?php
  2.  require_once 'VersionControl/SVN.php';
  3.  
  4.  // Set up runtime options. Will be passed to all
  5.  // subclasses.
  6.  $options = array('fetchmode' => VERSIONCONTROL_SVN_FETCHMODE_RAW);
  7.  
  8.  $switches = array('r' => 'HEAD');
  9.  $args = array('svn://svn.example.com/repos/TestProj/trunk',
  10.                '/my/export/path/Test-Project-1.0');
  11.  
  12.  $svn VersionControl_SVN::factory(array('export')$options);
  13.  try {
  14.      print_r($svn->export->run($args$switches));
  15.  catch (VersionControl_SVN_Exception $e{
  16.      print_r($e->getMessage());
  17.  }
  18.  
  19.  ?>

Example 2:

  1.  <?php
  2.  require_once 'VersionControl/SVN.php';
  3.  
  4.  // Set up runtime options. Will be passed to all
  5.  // subclasses.
  6.  $options = array('fetchmode' => VERSIONCONTROL_SVN_FETCHMODE_RAW);
  7.  
  8.  $args = array('/repos/TestProj/trunk',
  9.                '/my/export/path/Test-Project-1.0');
  10.  
  11.  $svn VersionControl_SVN::factory(array('export')$options);
  12.  try {
  13.      print_r($svn->export->run($args$switches));
  14.  catch (VersionControl_SVN_Exception $e{
  15.      print_r($e->getMessage());
  16.  }
  17.  
  18.  ?>

$switches is an array containing one or more command line options defined by the following associative keys:

  1.  $switches = array(
  2.   'r [revision]'  =>  'ARG (some commands also take ARG1:ARG2 range)
  3.                         A revision argument can be one of:
  4.                            NUMBER       revision number
  5.                            "{" DATE "}" revision at start of the date
  6.                            "HEAD"       latest in repository
  7.                            "BASE"       base rev of item's working copy
  8.                            "COMMITTED"  last commit at or before BASE
  9.                            "PREV"       revision just before COMMITTED',
  10.                       // either 'r' or 'revision' may be used
  11.   '[quiet]'     =>  true|false,
  12.                       // prints as little as possible
  13.   'force'         =>  true|false,
  14.                       // force operation to run
  15.   'username'      =>  'Subversion repository login',
  16.   'password'      =>  'Subversion repository password',
  17.   'no-auth-cache' =>  true|false,
  18.                       // Do not cache authentication tokens
  19.   'config-dir'    =>  'Path to a Subversion configuration directory'
  20.  );

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.



[ Top ]


Class Variables

$minArgs =  1

[line 171]

Minimum number of args required by this subcommand.

See Version Control with Subversion, Subversion Complete Reference for details on arguments for this subcommand.

  • Access: protected

Type:   int
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 176]

VersionControl_SVN_Command_Export __construct( )

Constuctor of command. Adds available switches.
  • Access: public

Overrides VersionControl_SVN_Command::__construct() (Constructor. Can't be called directly as class is abstract.)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:58:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.