Example #1
0
 /**
  * Start a full index building process
  * @return Whether it succeeded
  */
 public function buildFullIndex($index_comments = FALSE, $index_categories = FALSE, $immediate = FALSE)
 {
     WPSearch_Log::add('debug', "Registering shutdown hook to start build process");
     # TODO: Output status to file
     $status = array('total' => 0, 'current' => 0, 'last_rebuild' => time(), 'reindexing' => true, 'last_updated' => time());
     WPSearch_Utility::registerLogErrorHandlers();
     $this->_setStatusInfo($status);
     @set_time_limit(0);
     @ini_set("memory_limit", "256M");
     @ini_set("max_input_time", "-1");
     if (!$immediate) {
         @ignore_user_abort(true);
         @register_shutdown_function(array($this, 'asyncBuildFullIndex'), $index_comments, $index_categories);
     } else {
         $this->asyncBuildFullIndex();
     }
     return true;
 }