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

Class: VersionControl_SVN_Command_Mkdir

Source Location: /VersionControl_SVN-0.5.1/SVN/Command/Mkdir.php

Class Overview

VersionControl_SVN_Command
   |
   --VersionControl_SVN_Command_Mkdir

Subversion Mkdir command manager class


Author(s):

Version:

  • 0.5.1

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()
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 141]
Subversion Mkdir command manager class

Create a new directory under version control.

From svn mkdir --help:

usage: 1. mkdir PATH... 2. mkdir URL...

Create version controlled directories.

  1. Each directory specified by a working copy PATH is created locally and scheduled for addition upon the next commit.
2. Each directory specified by a URL is created in the repository via an immediate commit.

In both cases, all the intermediate directories must already exist.

New directories must include a message option (either with 'm', 'message', 'file' or 'F' keys), when the directory is created directly in the repository, as that results in an immediate commit.

$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.   'force-log'     =>  true|false,
  9.                       // force validity of log message source
  10.   'username'      =>  'Subversion repository login',
  11.   'password'      =>  'Subversion repository password',
  12.   'no-auth-cache' =>  true|false,
  13.                       // Do not cache authentication tokens
  14.   'encoding'      =>  'ARG',
  15.                       // treat value as being in charset encoding ARG
  16.   'config-dir'    =>  'Path to a Subversion configuration directory'
  17.  );

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('mkdir')$options);
  10.  
  11.  // Define any switches and aguments we may need
  12.  $switches = array('m' => 'Let\'s make a hole here ...''username' => 'user''password' => 'pass');
  13.  $args = array('svn://svn.example.com/repos/TestProj/trunk/newdir');
  14.  
  15.  // Run command
  16.  try {
  17.      print_r($svn->mkdir->run($args$switches));
  18.  catch (VersionControl_SVN_Exception $e{
  19.      print_r($e->getMessage());
  20.  }
  21.  ?>



[ Top ]


Class Variables

$minArgs =  1

[line 150]

Minimum number of args required by this subcommand.

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

  • Access: public

Type:   int
Overrides:   Array


[ Top ]

$requiredSwitches = array('m|message|F|file')

[line 159]

Switches required by this subcommand.

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

  • Access: public

Type:   array
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 164]

VersionControl_SVN_Command_Mkdir __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 Sat, 09 Feb 2013 12:30:12 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.