function upgrade_table_statistics_in_v3() { global $wpdb, $table_prefix; //check for column status $result = $wpdb->get_results("SHOW COLUMNS FROM {$table_prefix}sph_stats"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } foreach ($result as $column) { if ('status' == $column->Field) { $options['check_stats_table_column_status'] = 'true'; $this->config->update_admin_options($options); } } if ('true' == $options['check_stats_table_column_status']) { //set up sphinx for stats in widgest or not $wizard = new WizardController($this->config); $config_file_name = $this->config->get_option('sphinx_conf'); $config_file_content = $wizard->_generate_config_file_content(); $wizard->_save_config($config_file_name, $config_file_content); $sphinxService = new SphinxService($this->config); $ret = $sphinxService->reindex('stats'); } }