public function execute() { global $wgEchoCluster; $reader = new EchoBatchRowIterator(MWEchoDbFactory::getDB(DB_SLAVE), $this->table, $this->idField, $this->mBatchSize); $reader->addConditions(array("event_page_title IS NOT NULL", "event_page_id" => null)); $updater = new EchoBatchRowUpdate($reader, new EchoBatchRowWriter(MWEchoDbFactory::getDB(DB_MASTER), $this->table, $wgEchoCluster), new EchoSuppressionRowUpdateGenerator()); $updater->setOutput(array($this, '__internalOutput')); $updater->execute(); }
protected function doDBUpdates() { $iterator = new EchoBatchRowIterator(wfGetDB(DB_SLAVE), 'logging', 'log_id', $this->mBatchSize); $iterator->setFetchColumns(array('log_id', 'log_params')); $iterator->addConditions(array('log_type' => array('delete', 'suppress'), 'log_action' => array('flow-delete-post', 'flow-suppress-post', 'flow-restore-post', 'flow-delete-topic', 'flow-suppress-topic', 'flow-restore-topic'))); $updater = new EchoBatchRowUpdate($iterator, new EchoBatchRowWriter(wfGetDB(DB_MASTER), 'logging'), new LogRowUpdateGenerator($this)); $updater->setOutput(array($this, 'output')); $updater->execute(); return true; }
public function execute() { global $wgFlowCluster; $dbFactory = Container::get('db.factory'); $storage = Container::get('storage'); $rootPostLoader = Container::get('loader.root_post'); $iterator = new EchoBatchRowIterator($dbFactory->getDB(DB_SLAVE), 'flow_workflow', 'workflow_id', $this->mBatchSize); $iterator->setFetchColumns(array('workflow_id', 'workflow_type', 'workflow_last_update_timestamp')); $iterator->addConditions(array('workflow_wiki' => wfWikiId())); $updater = new EchoBatchRowUpdate($iterator, new UpdateWorkflowLastUpdateTimestampWriter($storage, $wgFlowCluster), new UpdateWorkflowLastUpdateTimestampGenerator($storage, $rootPostLoader)); $updater->setOutput(array($this, 'output')); $updater->execute(); }
/** * Assembles the update components, runs them, and reports * on what they did */ public function doDbUpdates() { global $wgFlowCluster, $wgLang; $dbw = Container::get('db.factory')->getDB(DB_MASTER); $it = new EchoBatchRowIterator($dbw, 'flow_workflow', 'workflow_id', $this->mBatchSize); $it->setFetchColumns(array('*')); $it->addConditions(array('workflow_wiki' => wfWikiId())); $gen = new WorkflowPageIdUpdateGenerator($wgLang); $writer = new EchoBatchRowWriter($dbw, 'flow_workflow', $wgFlowCluster); $updater = new EchoBatchRowUpdate($it, $writer, $gen); $updater->execute(); $this->output($gen->report()); return true; }