}
}
+/**
+ * Fake maintenance wrapper, mostly used for the web installer/updater
+ */
class FakeMaintenance extends Maintenance {
protected $mSelf = "FakeMaintenanceScript";
public function execute() {
}
}
+/**
+ * Class for scripts that perform database maintenance and want to log the
+ * update in `updatelog` so we can later skip it
+ */
abstract class LoggedUpdateMaintenance extends Maintenance {
public function __construct() {
parent::__construct();
$this->addOption( 'force', 'Run the update even if it was completed already' );
+ $this->setBatchSize( 200 );
}
public function execute() {
if ( !$this->hasOption( 'force' ) &&
$db->selectRow( 'updatelog', '1', array( 'ul_key' => $key ), __METHOD__ ) )
{
- $this->output( $this->updateSkippedMessage() . "\n" );
+ $this->output( "..." . $this->updateSkippedMessage() . "\n" );
return true;
}
}
}
+ /**
+ * Message to show the the update log was unable to log the completion of this update
+ * @return String
+ */
+ protected function updatelogFailedMessage() {
+ $key = $this->getUpdateKey();
+ return "Unable to log update '{$key}' as completed.";
+ }
+
/**
* Do the actual work. All child classes will need to implement this.
* Return true to log the update as done or false (usually on failure).
* @return String
*/
abstract protected function updateSkippedMessage();
-
- /**
- * Message to show the the update log was unable to log the completion of this update
- * @return String
- */
- abstract protected function updatelogFailedMessage();
}