/** * Executes all of the available initialization routines for CLI context * * @return void */ protected function processCLI() { $this->initializeDatabase(); $this->loadConfig(); $this->initializeLocalization(); // Needed for rebuilt of languages index // Trigger the onAfterInitialize event $this->eventManager->dispatch(iMSCP_Events::onAfterInitialize, array('context' => $this)); self::$_initialized = true; }
/** * Handle uncaught exceptions * * @param Exception $exception Uncaught exception * @return void */ public function handleException(Exception $exception) { try { foreach ($this->writers as $writer) { $this->em->registerListener('onUncaughtException', new $writer()); } $this->em->dispatch(new iMSCP_Exception_Event($exception)); } catch (Exception $e) { die(sprintf('Unable to handle uncaught exception thrown in file %s at line %s with message: %s', $e->getFile(), $e->getLine(), $e->getMessage())); } }