Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit c51530657a638bdcafe97a3055a1f510cbdcfd86 1 parent 876ba54
Alexander Opitz authored

Showing 2 changed files with 36 additions and 22 deletions. Show diff stats Hide diff stats

  1. +6 9 SVN.php
  2. +30 13 SVN/Command.php
15 SVN.php
@@ -239,17 +239,16 @@ public static function declareErrorMessages()
239 239 * <code>
240 240 *
241 241 * array(
242   - * 'url' => 'Subversion repository URL',
243 242 * 'username' => 'Subversion repository login',
244 243 * 'password' => 'Subversion repository password',
245   - * 'config_dir' => 'Path to a Subversion configuration directory',
  244 + * 'config-dir' => 'Path to a Subversion configuration directory',
246 245 * // [DEFAULT: null]
247   - * 'dry_run' => true/false,
248   - * // [DEFAULT: false]
249   - * 'encoding' => 'Language encoding to use for commit messages',
  246 + * 'config-option' => 'Set Subversion user configuration',
250 247 * // [DEFAULT: null]
251   - * 'svn_path' => 'Path to the svn client binary installed as part of Subversion',
  248 + * 'binaryPath' => 'Path to the svn client binary installed as part of Subversion',
252 249 * // [DEFAULT: /usr/local/bin/svn]
  250 + * 'fetchmode' => Type of returning of run function.
  251 + * // [DEFAULT: VERSIONCONTROL_SVN_FETCHMODE_ASSOC]
253 252 * )
254 253 *
255 254 * </code>
@@ -260,8 +259,6 @@ public static function declareErrorMessages()
260 259 * require_once 'VersionControl/SVN.php';
261 260 *
262 261 * $options = array(
263   - * 'url' => 'https://www.example.com/repos',
264   - * 'path' => 'your_project',
265 262 * 'username' => 'your_login',
266 263 * 'password' => 'your_password',
267 264 * );
@@ -269,7 +266,7 @@ public static function declareErrorMessages()
269 266 * // Run a log command
270 267 * $svn = VersionControl_SVN::factory('log', $options);
271 268 *
272   - * print_r($svn->run());
  269 + * print_r($svn->run(array('path_to_your_svn'));
273 270 * ?>
274 271 * </code>
275 272 *
43 SVN/Command.php
@@ -87,7 +87,7 @@
87 87 /**
88 88 * Location of the svn client binary installed as part of Subversion
89 89 *
90   - * @var string $binaryPath
  90 + * @var string $binaryPath
91 91 */
92 92 public $binaryPath = '/usr/local/bin/svn';
93 93
@@ -155,20 +155,34 @@
155 155 public $fetchmode = VERSIONCONTROL_SVN_FETCHMODE_ASSOC;
156 156
157 157 /**
158   - * The username to use for connections.
  158 + * Default username to use for connections.
159 159 *
160 160 * @var string $username
161 161 */
162 162 public $username = '';
163 163
164 164 /**
165   - * The password to use for connections.
  165 + * Default password to use for connections.
166 166 *
167 167 * @var string $password
168 168 */
169 169 public $password = '';
170 170
171 171 /**
  172 + * Default config-dir to use for connections.
  173 + *
  174 + * @var string $configDir
  175 + */
  176 + public $configDir = '';
  177 +
  178 + /**
  179 + * Default config-option to use for connections.
  180 + *
  181 + * @var string $configOption
  182 + */
  183 + public $configOption = '';
  184 +
  185 + /**
172 186 * SVN subcommand to run.
173 187 *
174 188 * @var string $commandName
@@ -202,6 +216,8 @@
202 216 protected $validSwitchesValue = array(
203 217 'username',
204 218 'password',
  219 + 'config-dir',
  220 + 'config-option',
205 221 );
206 222
207 223 /**
@@ -211,8 +227,6 @@
211 227 'no-auth-cache',
212 228 'non-interactive',
213 229 'trust-server-cert',
214   - 'config-dir',
215   - 'config-option',
216 230 );
217 231
218 232 /**
@@ -354,15 +368,18 @@ protected function preProcessSwitches()
354 368 }
355 369 $this->switches['non-interactive'] = true;
356 370
357   - if (!isset($this->switches['username'])
358   - && '' !== $this->username
359   - ) {
360   - $this->switches['username'] = $this->username;
361   - }
362   - if (!isset($this->switches['password'])
363   - && '' !== $this->password
  371 + $this->fillSwitch('username', $this->username);
  372 + $this->fillSwitch('password', $this->password);
  373 + $this->fillSwitch('config-dir', $this->configDir);
  374 + $this->fillSwitch('config-option', $this->configOption);
  375 + }
  376 +
  377 + protected function fillSwitch($switchName, $value)
  378 + {
  379 + if (!isset($this->switches[$switchName])
  380 + && '' !== $value
364 381 ) {
365   - $this->switches['password'] = $this->password;
  382 + $this->switches[$switchName] = $value;
366 383 }
367 384 }
368 385

0 comments on commit c515306

Please sign in to comment.
Something went wrong with that request. Please try again.