Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug #19465 - Update docu, implement config-dir/config-option

  • Loading branch information...
commit c51530657a638bdcafe97a3055a1f510cbdcfd86 1 parent 876ba54
Alexander Opitz authored
Showing with 36 additions and 22 deletions.
  1. +6 −9 SVN.php
  2. +30 −13 SVN/Command.php
15 SVN.php
View
@@ -239,17 +239,16 @@ public static function declareErrorMessages()
* <code>
*
* array(
- * 'url' => 'Subversion repository URL',
* 'username' => 'Subversion repository login',
* 'password' => 'Subversion repository password',
- * 'config_dir' => 'Path to a Subversion configuration directory',
+ * 'config-dir' => 'Path to a Subversion configuration directory',
* // [DEFAULT: null]
- * 'dry_run' => true/false,
- * // [DEFAULT: false]
- * 'encoding' => 'Language encoding to use for commit messages',
+ * 'config-option' => 'Set Subversion user configuration',
* // [DEFAULT: null]
- * 'svn_path' => 'Path to the svn client binary installed as part of Subversion',
+ * 'binaryPath' => 'Path to the svn client binary installed as part of Subversion',
* // [DEFAULT: /usr/local/bin/svn]
+ * 'fetchmode' => Type of returning of run function.
+ * // [DEFAULT: VERSIONCONTROL_SVN_FETCHMODE_ASSOC]
* )
*
* </code>
@@ -260,8 +259,6 @@ public static function declareErrorMessages()
* require_once 'VersionControl/SVN.php';
*
* $options = array(
- * 'url' => 'https://www.example.com/repos',
- * 'path' => 'your_project',
* 'username' => 'your_login',
* 'password' => 'your_password',
* );
@@ -269,7 +266,7 @@ public static function declareErrorMessages()
* // Run a log command
* $svn = VersionControl_SVN::factory('log', $options);
*
- * print_r($svn->run());
+ * print_r($svn->run(array('path_to_your_svn'));
* ?>
* </code>
*
43 SVN/Command.php
View
@@ -87,7 +87,7 @@
/**
* Location of the svn client binary installed as part of Subversion
*
- * @var string $binaryPath
+ * @var string $binaryPath
*/
public $binaryPath = '/usr/local/bin/svn';
@@ -155,20 +155,34 @@
public $fetchmode = VERSIONCONTROL_SVN_FETCHMODE_ASSOC;
/**
- * The username to use for connections.
+ * Default username to use for connections.
*
* @var string $username
*/
public $username = '';
/**
- * The password to use for connections.
+ * Default password to use for connections.
*
* @var string $password
*/
public $password = '';
/**
+ * Default config-dir to use for connections.
+ *
+ * @var string $configDir
+ */
+ public $configDir = '';
+
+ /**
+ * Default config-option to use for connections.
+ *
+ * @var string $configOption
+ */
+ public $configOption = '';
+
+ /**
* SVN subcommand to run.
*
* @var string $commandName
@@ -202,6 +216,8 @@
protected $validSwitchesValue = array(
'username',
'password',
+ 'config-dir',
+ 'config-option',
);
/**
@@ -211,8 +227,6 @@
'no-auth-cache',
'non-interactive',
'trust-server-cert',
- 'config-dir',
- 'config-option',
);
/**
@@ -354,15 +368,18 @@ protected function preProcessSwitches()
}
$this->switches['non-interactive'] = true;
- if (!isset($this->switches['username'])
- && '' !== $this->username
- ) {
- $this->switches['username'] = $this->username;
- }
- if (!isset($this->switches['password'])
- && '' !== $this->password
+ $this->fillSwitch('username', $this->username);
+ $this->fillSwitch('password', $this->password);
+ $this->fillSwitch('config-dir', $this->configDir);
+ $this->fillSwitch('config-option', $this->configOption);
+ }
+
+ protected function fillSwitch($switchName, $value)
+ {
+ if (!isset($this->switches[$switchName])
+ && '' !== $value
) {
- $this->switches['password'] = $this->password;
+ $this->switches[$switchName] = $value;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.