public function onRebuild(Am_Event_Rebuild $event) { $batch = new Am_BatchProcessor(array($this, 'batchProcess'), 5); $context = $event->getDoneString(); $this->_rebuildName = $this->getId(); $this->_sessionId = Zend_Session::getId(); if ($batch->run($context)) { $event->setDone(); $this->getDi()->storeRebuild->deleteByNameAndSession($this->_rebuildName, $this->_sessionId); } else { $event->setDoneString($context); } }
function onRebuild(Am_Event_Rebuild $event) { $batch = new Am_BatchProcessor(array($this, 'batchProcess'), 5); $context = $event->getDoneString(); $this->_batchStoreId = 'rebuild-' . $this->getId() . '-' . Zend_Session::getId(); if ($batch->run($context)) { $event->setDone(); } else { $event->setDoneString($context); } }
function doAction() { if (!$this->_request->isPost() || !$this->_request->get('do')) { throw new Am_Exception_InputError("Wrong request"); } @ignore_user_abort(true); @set_time_limit(0); @ini_set('memory_limit', '256M'); $do = $this->_request->getFiltered('do'); @(list($do, $doneString) = explode("-", $do, 2)); $callback = $this->getTarget($do); if (!$callback) { throw new Am_Exception_InputError("Wrong request - plugin [{$do}] not found"); } $this->printStarted($callback[0]->getTitle() . " Db"); $event = new Am_Event_Rebuild(); $event->setDoneString($doneString); call_user_func($callback, $event); $this->printFinished($do, $event); }
function onRebuild(Am_Event_Rebuild $event) { $this->getDi()->db->query("DELETE FROM ?_newsletter_user_subscription \n WHERE list_id not in (SELECT list_id from ?_newsletter_list)"); $batch = new Am_BatchProcessor(array($this, 'batchProcess'), 5); $context = $event->getDoneString(); $this->_batchStoreId = 'rebuild-' . $this->getId() . '-' . Zend_Session::getId(); if ($batch->run($context)) { $event->setDone(); } else { $event->setDoneString($context); } }