Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php |
— | — | @@ -213,6 +213,26 @@ |
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
| 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 | + /** |
217 | 237 | * Get the space-seperated list of version params for this wiki. |
218 | 238 | * The first item is the MW version and the optional second item |
219 | 239 | * an extra version parameter to use for builds and caches. |