[feature/sphinx-fulltext-search] remove unnecessary code

Some extra conditions and variables used in autoconf are removed.

PHPBB3-10946
This commit is contained in:
Dhruv Goel 2012-07-10 04:53:51 +05:30 committed by Dhruv
parent 569db1471b
commit d2e42d7d61

View file

@ -59,11 +59,8 @@ class phpbb_search_fulltext_sphinx
$this->sphinx = new SphinxClient(); $this->sphinx = new SphinxClient();
if (!empty($config['fulltext_sphinx_configured'])) // We only support localhost for now
{ $this->sphinx->SetServer('localhost', (isset($config['fulltext_sphinx_port']) && $config['fulltext_sphinx_port']) ? (int) $config['fulltext_sphinx_port'] : 3312);
// we only support localhost for now
$this->sphinx->SetServer('localhost', (isset($config['fulltext_sphinx_port']) && $config['fulltext_sphinx_port']) ? (int) $config['fulltext_sphinx_port'] : 3312);
}
$config['fulltext_sphinx_min_word_len'] = 2; $config['fulltext_sphinx_min_word_len'] = 2;
$config['fulltext_sphinx_max_word_len'] = 400; $config['fulltext_sphinx_max_word_len'] = 400;
@ -125,7 +122,7 @@ class phpbb_search_fulltext_sphinx
// now that we're sure everything was entered correctly, generate a config for the index // now that we're sure everything was entered correctly, generate a config for the index
// we misuse the avatar_salt for this, as it should be unique ;-) // we misuse the avatar_salt for this, as it should be unique ;-)
$config_object = new phpbb_search_sphinx_config($config['fulltext_sphinx_config_path'] . 'sphinx.conf'); $config_object = new phpbb_search_sphinx_config($config['fulltext_sphinx_config_path'] . 'sphinx.conf');
$config_data = array( $config_data = array(
'source source_phpbb_' . $this->id . '_main' => array( 'source source_phpbb_' . $this->id . '_main' => array(
@ -266,10 +263,6 @@ class phpbb_search_fulltext_sphinx
} }
} }
set_config('fulltext_sphinx_configured', '1');
$this->tidy();
return false; return false;
} }
@ -613,11 +606,6 @@ class phpbb_search_fulltext_sphinx
{ {
global $db, $user, $config; global $db, $user, $config;
if (!isset($config['fulltext_sphinx_configured']) || !$config['fulltext_sphinx_configured'])
{
return $user->lang['FULLTEXT_SPHINX_CONFIGURE_FIRST'];
}
if (!$this->index_created()) if (!$this->index_created())
{ {
$sql = 'CREATE TABLE IF NOT EXISTS ' . SPHINX_TABLE . ' ( $sql = 'CREATE TABLE IF NOT EXISTS ' . SPHINX_TABLE . ' (
@ -630,9 +618,6 @@ class phpbb_search_fulltext_sphinx
$db->sql_query($sql); $db->sql_query($sql);
} }
// start indexing process
$this->tidy(true);
return false; return false;
} }
@ -645,7 +630,7 @@ class phpbb_search_fulltext_sphinx
*/ */
function delete_index($acp_module, $u_action) function delete_index($acp_module, $u_action)
{ {
global $db, $config; global $db;
if (!$this->index_created()) if (!$this->index_created())
{ {
@ -715,7 +700,7 @@ class phpbb_search_fulltext_sphinx
*/ */
function get_stats() function get_stats()
{ {
global $db, $config; global $db;
if ($this->index_created()) if ($this->index_created())
{ {