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

Class: VersionControl_SVN

Source Location: /VersionControl_SVN-0.3.1/SVN.php

Class Overview


Simple OO interface for Subversion


Author(s):

Version:

  • 0.3.1

Copyright:

  • Copyright (c) 2004 Clay Loveless. All Rights Reserved.

Variables

Methods


Child classes:

VersionControl_SVN_Proplist
Subversion Proplist command manager class
VersionControl_SVN_Cat
Subversion Cat command manager class
VersionControl_SVN_Merge
Subversion Merge command manager class
VersionControl_SVN_Checkout
Subversion Checkout command manager class
VersionControl_SVN_Propget
Subversion Propget command manager class
VersionControl_SVN_Commit
Subversion Commit command manager class
VersionControl_SVN_List
Subversion List command manager class
VersionControl_SVN_Move
Subversion Move command manager class
VersionControl_SVN_Delete
Subversion Delete command manager class
VersionControl_SVN_Add
Subversion Add command manager class
VersionControl_SVN_Switch
Subversion Switch command manager class
VersionControl_SVN_Info
Subversion Info command manager class
VersionControl_SVN_Mkdir
Subversion Mkdir command manager class
VersionControl_SVN_Copy
Subversion Copy command manager class
VersionControl_SVN_Status
Subversion Status command manager class
VersionControl_SVN_Diff
Subversion Diff command manager class
VersionControl_SVN_Resolved
Subversion Resolved command manager class
VersionControl_SVN_Update
Subversion Update command manager class
VersionControl_SVN_Blame
Subversion Blame command manager class
VersionControl_SVN_Propdel
Subversion Propdel command manager class
VersionControl_SVN_Export
Subversion Export command manager class
VersionControl_SVN_Propset
Subversion Propset command manager class
VersionControl_SVN_Import
Subversion Import command manager class
VersionControl_SVN_Log
Subversion Log command manager class
VersionControl_SVN_Cleanup
Subversion Cleanup command manager class
VersionControl_SVN_Revert
Subversion Revert command manager class

Inherited Variables

Inherited Methods


Class Details

[line 132]
Simple OO interface for Subversion


[ Top ]


Class Variables

$fetchmode =  VERSIONCONTROL_SVN_FETCHMODE_ASSOC

[line 251]

Preferred fetchmode. Note that not all subcommands have output available for each preferred fetchmode. The default cascade is:

VERSIONCONTROL_SVN_FETCHMODE_ASSOC VERSIONCONTROL_SVN_FETCHMODE_RAW

If the specified fetchmode isn't available, raw output will be returned.

  • Access: public

Type:   int


[ Top ]

$options = array()

[line 237]

Runtime options being used.
  • Access: public

Type:   array


[ Top ]

$prepend_cmd =  ''

[line 221]

String to prepend to command string. Helpful for setting exec() environment variables, such as: export LANG=en_US.utf8 && ... to support non-ASCII file and directory names.
  • Access: public

Type:   string


[ Top ]

$shortcuts = array(

            'praise'    => 'Blame',
            'annotate'  => 'Blame',
            'ann'       => 'Blame',
            'co'        => 'Checkout',
            'ci'        => 'Commit',
            'cp'        => 'Copy',
            'del'       => 'Delete',
            'remove'    => 'Delete',
            'rm'        => 'Delete',
            'di'        => 'Diff',
            'ls'        => 'List',
            'mv'        => 'Move',
            'rename'    => 'Move',
            'ren'       => 'Move',
            'pdel'      => 'Propdel',
            'pd'        => 'Propdel',
            'pget'      => 'Propget',
            'pg'        => 'Propget',
            'plist'     => 'Proplist',
            'pl'        => 'Proplist',
            'pset'      => 'Propset',
            'ps'        => 'Propset',
            'stat'      => 'Status',
            'st'        => 'Status',
            'sw'        => 'Switch',
            'up'        => 'Update'
        )

[line 164]

Reference array of subcommand shortcuts. Provided for convenience for those who prefer the shortcuts they're used to using with the svn command-line tools.

You may specify your own shortcuts by passing them in to the factory. For example:

  1.  <?php
  2.  require_once 'VersionControl/SVN.php';
  3.  
  4.  $options['shortcuts'= array('boot' => 'Delete''checkin' => 'Commit');
  5.  
  6.  $svn VersionControl_SVN::factory(array('boot''checkin')$options);
  7.  
  8.  $switches = array('username' => 'user''password' => 'pass''force' => true);
  9.  $args = array('svn://svn.example.com/repos/TestProject/file_to_delete.txt');
  10.  
  11.  $svn->boot->run($switches$args);
  12.  
  13.  ?>

  • Access: public

Type:   array


[ Top ]

$svn_cmd_parser =

[line 259]

XML::Parser class to use for parsing XML output
  • Access: public

Type:   string


[ Top ]

$svn_path =  '/usr/local/bin/svn'

[line 210]

Location of the svn client binary installed as part of Subversion
  • Access: public

Type:   string


[ Top ]

$switches = array()

[line 229]

Array of switches to use in building svn command
  • Access: public

Type:   array


[ Top ]

$use_escapeshellcmd =  true

[line 202]

Indicates whether commands passed to the exec() function in the run method should be passed through escapeshellcmd().
  • Access: public

Type:   bool


[ Top ]



Method Detail

apiVersion   [line 689]

string apiVersion( )

Return the VersionControl_SVN API version
  • Return: the VersionControl_SVN API version number
  • Access: public

[ Top ]

checkCommandRequirements   [line 563]

mixed checkCommandRequirements( void 0)

Standardized validation of requirements for a command class.
  • Return: true if all requirements are met, false if requirements are not met. Details of failures are pushed into the PEAR_ErrorStack for VersionControl_SVN
  • Access: public

Parameters:

void   0   — 

[ Top ]

declareErrorMessages   [line 322]

array declareErrorMessages( void 0)

Set up VersionControl_SVN error message templates for PEAR_ErrorStack.
  • Access: public

Parameters:

void   0   — 

[ Top ]

factory   [line 405]

mixed &factory( $command, [array $options = array()])

Create a new VersionControl_SVN command object.

$switches is an array containing multiple options defined by the following associative keys:

  1.  array(
  2.   'url'           => 'Subversion repository URL',
  3.   'username'      => 'Subversion repository login',
  4.   'password'      => 'Subversion repository password',
  5.   'config_dir'    => 'Path to a Subversion configuration directory',
  6.                      // [DEFAULT: null]
  7.   'dry_run'       => true/false,
  8.                      // [DEFAULT: false]
  9.   'encoding'      => 'Language encoding to use for commit messages',
  10.                      // [DEFAULT: null]
  11.   'svn_path'      => 'Path to the svn client binary installed as part of Subversion',
  12.                      // [DEFAULT: /usr/local/bin/svn]
  13.  )

Example 1.

  1.  <?php
  2.  require_once 'VersionControl/SVN.php';
  3.  
  4.  $options = array(
  5.       'url'        => 'https://www.example.com/repos',
  6.       'path'       => 'your_project',
  7.       'username'   => 'your_login',
  8.       'password'   => 'your_password',
  9.  );
  10.  
  11.  // Run a log command
  12.  $svn VersionControl_SVN::factory('log'$options);
  13.  
  14.  print_r($svn->run());
  15.  ?>

  • Return: a newly created VersionControl_SVN command object, or PEAR_ErrorStack constant on error
  • Access: public

Parameters:

array   $options   —  An associative array of option names and their values
   $command   — 

[ Top ]

fetchCommands   [line 474]

mixed fetchCommands( )

Scan through the SVN directory looking for subclasses.
  • Return: array on success, false on failure
  • Access: public

[ Top ]

fetchShortcuts   [line 505]

array fetchShortcuts( void 0)

Return the array of pre-defined shortcuts (also known as Alternate Names) for Subversion commands.
  • Access: public

Parameters:

void   0   — 

[ Top ]

init   [line 436]

mixed init( $command, $options)

Initialize an object wrapper for a Subversion subcommand.
  • Return: object on success, false on failure
  • Access: public

Parameters:

   $command   — 
   $options   — 

[ Top ]

parseOutput   [line 674]

mixed parseOutput( array $out)

Handle output parsing chores.

This bare-bones function should be overridden by the command class.

  • Return: Returns output requested by fetchmode (if available), or raw output if desired fetchmode is not available.
  • Access: public

Overridden in child classes as:

VersionControl_SVN_Proplist::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Cat::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Merge::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Checkout::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Propget::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Commit::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_List::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Move::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Delete::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Add::parseOutput()
Handles output parsing of output of command.
VersionControl_SVN_Switch::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Info::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Mkdir::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Copy::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Status::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Diff::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Resolved::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Update::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Blame::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Propdel::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Export::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Propset::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Import::parseOutput()
Handles output parsing of standard and verbose output of command.
VersionControl_SVN_Log::parseOutput()
Handles output parsing of output of Log command.
VersionControl_SVN_Revert::parseOutput()
Handles output parsing of standard and verbose output of command.

Parameters:

array   $out   —  Array of output captured by exec command in run.

[ Top ]

prepare   [line 544]

void prepare( )

Prepare the command switches.

This function should be overloaded by the command class.


Overridden in child classes as:

VersionControl_SVN_Proplist::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Cat::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Merge::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Checkout::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Propget::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Commit::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_List::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Move::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Delete::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Add::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Switch::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Info::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Mkdir::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Copy::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Status::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Diff::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Resolved::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Update::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Blame::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Propdel::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Export::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Propset::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Import::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Log::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Cleanup::prepare()
Prepare the svn subcommand switches.
VersionControl_SVN_Revert::prepare()
Prepare the svn subcommand switches.

[ Top ]

run   [line 619]

mixed run( [void $args = array()], [ $switches = array()])

Run the command with the defined switches.
  • Return: specified output on success, or false on failure.
  • Access: public

Parameters:

void   $args   — 
   $switches   — 

[ Top ]

setOptions   [line 518]

void setOptions( [ $options = array()])

Allow for overriding of previously declared options.

Parameters:

   $options   — 

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:47:00 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.