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

Class: VersionControl_SVN

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

Class Overview


Simple OO interface for Subversion


Author(s):

Version:

  • 0.5.2

Copyright:

  • 2004-2007 Clay Loveless

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 109]
Simple OO interface for Subversion


[ Top ]


Class Variables

$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 139]

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(
  9.                  'username' => 'user''password' => 'pass''force' => true
  10.              );
  11.  $args = array('svn://svn.example.com/repos/TestProject/file_to_delete.txt');
  12.  
  13.  $svn->boot->run($switches$args);
  14.  
  15.  ?>

  • Var: Possible shortcuts and their real commands.
  • Access: public

Type:   array


[ Top ]



Method Detail

apiVersion   [line 314]

string apiVersion( )

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

[ Top ]

factory   [line 216]

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

Create a new VersionControl_SVN command object.

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

  1.  array(
  2.   'username'      => 'Subversion repository login',
  3.   'password'      => 'Subversion repository password',
  4.   'config-dir'    => 'Path to a Subversion configuration directory',
  5.                      // [DEFAULT: null]
  6.   'config-option' => 'Set Subversion user configuration',
  7.                      // [DEFAULT: null]
  8.   'binaryPath'    => 'Path to the svn client binary installed as part of Subversion',
  9.                      // [DEFAULT: /usr/local/bin/svn]
  10.   'fetchmode'     => Type of returning of run function.
  11.                      // [DEFAULT: VERSIONCONTROL_SVN_FETCHMODE_ASSOC]
  12.  )

Example 1.

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

  • Return: A newly created command object or an stdObj with the command objects set.
  • Throws: VersionControl_SVN_Exception Exception if command init fails.
  • Access: public

Parameters:

string   $command     The Subversion command
array   $options     An associative array of option names and their values

[ Top ]

fetchCommands   [line 284]

array fetchCommands( )

Scan through the SVN directory looking for subclasses.
  • Return: Array with names of commands as value.
  • Throws: VersionControl_SVN_Exception Exception if fetching commands fails.
  • Access: public

[ Top ]

init   [line 246]

VersionControl_SVN_Command init( string $command, array $options)

Initialize an object wrapper for a Subversion subcommand.
  • Return: Instance of command.
  • Throws: VersionControl_SVN_Exception Exception if command init fails.
  • Access: public

Parameters:

string   $command     The Subversion command
array   $options     An associative array of option names and their values

[ Top ]


Documentation generated on Mon, 29 Sep 2014 09:00:08 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.