Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -351,6 +351,7 @@ |
352 | 352 | $this->addOption( 'conf', 'Location of LocalSettings.php, if not default', false, true ); |
353 | 353 | $this->addOption( 'wiki', 'For specifying the wiki ID', false, true ); |
354 | 354 | $this->addOption( 'globals', 'Output globals at the end of processing for debugging' ); |
| 355 | + $this->addOption( 'memory-limit', 'Set a specific memory limit for the script' ); |
355 | 356 | // If we support a DB, show the options |
356 | 357 | if ( $this->getDbType() > 0 ) { |
357 | 358 | $this->addOption( 'dbuser', 'The DB user to use for this script', false, true ); |
— | — | @@ -461,10 +462,13 @@ |
462 | 463 | /** |
463 | 464 | * Normally we disable the memory_limit when running admin scripts. |
464 | 465 | * Some scripts may wish to actually set a limit, however, to avoid |
465 | | - * blowing up unexpectedly. |
| 466 | + * blowing up unexpectedly. We also support a --memory-limit option, |
| 467 | + * to allow sysadmins to explicitly set one if they'd prefer to override |
| 468 | + * defaults (or for people using Suhosin which yells at you for trying |
| 469 | + * to disable the limits) |
466 | 470 | */ |
467 | 471 | public function memoryLimit() { |
468 | | - return -1; |
| 472 | + return $this->getOption( 'memory-limit', -1 ); |
469 | 473 | } |
470 | 474 | |
471 | 475 | /** |