private function forceSyncMode() { $config = Zend_Registry::get('Zend_Config'); if (isset($config->runjobs->asynchronous) && $config->runjobs->asynchronous) { $this->syncMode = false; $config->runjobs->asynchronous = 0; Zend_Registry::set('Zend_Config', $config); } } private function resetMode() { if (!$this->syncMode) { $config = Zend_Registry::get('Zend_Config'); $config->runjobs->asynchronous = 1; Zend_Registry::set('Zend_Config', $config); } } } $index = new SolrIndexBuilder(); try { $runtime = (int) $index->run(); echo "\nOperation completed successfully in {$runtime} seconds.\n"; } catch (Opus_SolrSearch_Index_Exception $e) { echo "\nAn error occurred while indexing."; echo "\nError Message: " . $e->getMessage(); if (!is_null($e->getPrevious())) { echo "\nCaused By: " . $e->getPrevious()->getMessage(); } echo "\nStack Trace:\n" . $e->getTraceAsString(); echo "\n\n"; }
} } private function forceSyncMode() { $config = Zend_Registry::get('Zend_Config'); if (isset($config->runjobs->asynchronous) && $config->runjobs->asynchronous) { $this->_syncMode = false; $config->runjobs->asynchronous = 0; Zend_Registry::set('Zend_Config', $config); } } private function resetMode() { if (!$this->_syncMode) { $config = Zend_Registry::get('Zend_Config'); $config->runjobs->asynchronous = 1; Zend_Registry::set('Zend_Config', $config); } } private function write($str) { echo $str; } } /** * Main code of index builder script. */ global $argc, $argv; $builder = new SolrIndexBuilder(); $builder->run($argc, $argv);