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

Class: VersionControl_SVN_Command_Add

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

Class Overview

VersionControl_SVN_Command
   |
   --VersionControl_SVN_Command_Add

Subversion Add 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 126]
Subversion Add command manager class

Put files and directories under version control, scheduling them for addition to repository. They will be added in next commit.

While it may or may not seem obvious, it's worth mentioning that the path to the file being added should already be an Subversion project working copy.

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

  1.  array(
  2.   'config-dir'    =>  'Path to a Subversion configuration directory',
  3.   'targets'       =>  'ARG',
  4.                       // pass contents of file ARG as additional args
  5.   'q [quiet]'     =>  true|false,
  6.                      // prints as little as possible
  7.   'v [verbose]'   =>  true|false,
  8.                       // prints extra information
  9.   'N'             =>  true|false,
  10.                       // operate on single directory only
  11.   'non-recursive' =>  true|false,
  12.                       // operate on single directory only
  13.   'auto-props'    =>  true|false,
  14.                       // enable automatic properties. Setting to false IS NOT
  15.                       // the same as setting no-auto-props to true.
  16.   'no-auto-props' =>  true|false
  17.                       // disable automatic properties. Setting to false IS NOT
  18.                       // the same as setting auto-props to true.
  19.  );

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('add')$options);
  10.  
  11.  // Define any switches and aguments we may need
  12.  $switches = array();
  13.  $args = array('/local_working_files/myproject/newfile.php');
  14.  
  15.  // Run command
  16.  try {
  17.      print_r($svn->add->run($args$switches));
  18.  catch (VersionControl_SVN_Exception $e{
  19.      print_r($e->getMessage());
  20.  }
  21.  ?>

Note: Subversion does not offer an XML output option for this subcommand



[ Top ]


Class Variables

$minArgs =  1

[line 135]

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 140]

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