r110314 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110313‎ | r110314 | r110315 >
Date:18:53, 30 January 2012
Author:aaron
Status:ok (Comments)
Tags:tools 
Comment:
Added WMF handler for wfShellMaintenanceCmd hook for things like r110104.
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php
@@ -213,6 +213,26 @@
214214 }
215215
216216 /**
 217+ * Handler for the wfShellMaintenanceCmd hook.
 218+ * This converts shell commands like "php $IP/maintenance/foo.php" into
 219+ * commands that use the "MWScript.php" wrapper, for example:
 220+ * "php /home/wikipedia/common/multiversion/MWScript.php maintenance/foo.php"
 221+ *
 222+ * @param &$script string
 223+ * @param &$params Array
 224+ * @param &$options Array
 225+ * @return boolean
 226+ */
 227+ public static function onWfShellMaintenanceCmd( &$script, array &$params, array &$options ) {
 228+ global $IP;
 229+ if ( strpos( $script, "{$IP}/" ) === 0 ) {
 230+ $script = substr( $script, strlen( "{$IP}/" ) );
 231+ $options['wrapper'] = '/home/wikipedia/common/multiversion/MWScript.php';
 232+ }
 233+ return true;
 234+ }
 235+
 236+ /**
217237 * Get the space-seperated list of version params for this wiki.
218238 * The first item is the MW version and the optional second item
219239 * an extra version parameter to use for builds and caches.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110104- pass wiki option to job threads in maintenance script...j06:25, 27 January 2012

Comments

#Comment by Reedy (talk | contribs)   22:06, 2 February 2012

Does this not need registering or something?

#Comment by Aaron Schulz (talk | contribs)   22:06, 2 February 2012

It does, haven't done it in the config yet.

Status & tagging log