wfRunHooks() -> Hooks::run() in maintenance scripts
[lhc/web/wiklou.git] / maintenance / cleanupRemovedModules.php
index 84eec28..e1d0ed6 100644 (file)
@@ -36,12 +36,18 @@ class CleanupRemovedModules extends Maintenance {
                parent::__construct();
                $this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database';
                $this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true );
-               $this->addOption( 'max-slave-lag', 'If the slave lag exceeds this many seconds, wait until it drops below this value. Default: 5', false, true );
+               $this->addOption(
+                       'max-slave-lag',
+                       'If the slave lag exceeds this many seconds, wait until it drops below this value. '
+                               . 'Default: 5',
+                       false,
+                       true
+               );
        }
 
        public function execute() {
                $dbw = wfGetDB( DB_MASTER );
-               $rl = new ResourceLoader();
+               $rl = new ResourceLoader( ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
                $moduleNames = $rl->getModuleNames();
                $moduleList = implode( ', ', array_map( array( $dbw, 'addQuotes' ), $moduleNames ) );
                $limit = max( 1, intval( $this->getOption( 'batchsize', 500 ) ) );