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

Class: VersionControl_SVN_Command_Copy

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

Class Overview

VersionControl_SVN_Command
   |
   --VersionControl_SVN_Command_Copy

Subversion Copy command manager class


Author(s):

Version:

  • 0.5.2

Copyright:

  • 2004-2007 Clay Loveless

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 143]
Subversion Copy command manager class

Duplicate something in working copy or repos, remembering history.

SRC and DST can each be either a working copy (WC) path or URL: WC -> WC: copy and schedule for addition (with history) WC -> URL: immediately commit a copy of WC to URL URL -> WC: check out URL into WC, schedule for addition URL -> URL: complete server-side copy; used to branch & tag

Copies must include a message option (either with 'm', 'message', 'file' or 'F' keys), but the message itself may be blank.

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

  1.  $switches = array(
  2.   'm [message]'   =>  'Specified commit message',
  3.                       // either 'm' or 'message' may be used
  4.   'F [file]'      =>  'Read commit message data from specified file',
  5.                       // either 'F' or 'file' may be used
  6.   'q [quiet]'     =>  true|false,
  7.                       // prints as little as possible
  8.   'r [revision]'  =>  'ARG (some commands also take ARG1:ARG2 range)
  9.                         A revision argument can be one of:
  10.                            NUMBER       revision number
  11.                            "{" DATE "}" revision at start of the date
  12.                            "HEAD"       latest in repository
  13.                            "BASE"       base rev of item's working copy
  14.                            "COMMITTED"  last commit at or before BASE
  15.                            "PREV"       revision just before COMMITTED',
  16.                       // either 'r' or 'revision' may be used
  17.   'force-log'     =>  true|false,
  18.                       // force validity of log message source
  19.   'username'      =>  'Subversion repository login',
  20.   'password'      =>  'Subversion repository password',
  21.   'no-auth-cache' =>  true|false,
  22.                       // Do not cache authentication tokens
  23.   'encoding'      =>  'ARG',
  24.                       // treat value as being in charset encoding ARG
  25.   'config-dir'    =>  'Path to a Subversion configuration directory',
  26.   'parents'       =>  true|false
  27.  );

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.

The editor-cmd option available on the command-line svn client is not available since this class does not operate as an interactive shell session.

Usage example:

  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.  // Pass array of subcommands we need to factory
  9.  $svn VersionControl_SVN::factory(array('copy')$options);
  10.  
  11.  // Define any switches and aguments we may need
  12.  $switches = array('m' => 'Whoops! Better get this in all the right places',
  13.                    'username' => 'user''password' => 'pass');
  14.  $args = array('svn://svn.example.com/repos/TestProj/trunk/template1/index.tpl',
  15.                'svn://svn.example.com/repos/TestProj/trunk/template2/index.tpl');
  16.  
  17.  // Run command
  18.  try {
  19.      print_r($svn->copy->run($args$switches));
  20.  catch (VersionControl_SVN_Exception $e{
  21.      print_r($e->getMessage());
  22.  }
  23.  ?>



[ Top ]


Method Detail

__construct (Constructor)   [line 148]

VersionControl_SVN_Command_Copy __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.