mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-03 16:48:52 +00:00
[feature/sphinx-fulltext-search] display config file in ACP
sphinx config file is generated and displayed in the ACP for user to use it to start sphinx search daemon. PHPBB3-10946
This commit is contained in:
parent
b16e70ae1d
commit
4b40f0d3c6
2 changed files with 16 additions and 9 deletions
|
@ -112,11 +112,6 @@ class phpbb_search_fulltext_sphinx
|
||||||
return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE'];
|
return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error = $this->config_updated())
|
|
||||||
{
|
|
||||||
return $error;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Move delta to main index each hour
|
// Move delta to main index each hour
|
||||||
set_config('search_gc', 3600);
|
set_config('search_gc', 3600);
|
||||||
|
|
||||||
|
@ -124,16 +119,21 @@ class phpbb_search_fulltext_sphinx
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the config file sphinx.conf and generates the same in case autoconf is selected
|
* Generates content of sphinx.conf
|
||||||
*
|
*
|
||||||
* @return string|bool Language key of the error/incompatiblity occured otherwise false
|
* @return bool True if sphinx.conf content is correctly generated, false otherwise
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function config_updated()
|
function config_generate()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
if (!$this->config['fulltext_sphinx_data_path'] || !$this->config['fulltext_sphinx_config_path'])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
include ($phpbb_root_path . 'config.' . $phpEx);
|
include ($phpbb_root_path . 'config.' . $phpEx);
|
||||||
|
|
||||||
/* Now that we're sure everything was entered correctly,
|
/* Now that we're sure everything was entered correctly,
|
||||||
|
@ -280,7 +280,7 @@ class phpbb_search_fulltext_sphinx
|
||||||
}
|
}
|
||||||
$this->config_file_data = $config_object->get_data();
|
$this->config_file_data = $config_object->get_data();
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -767,6 +767,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
<dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt>
|
<dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt>
|
||||||
<dd><input id="fulltext_sphinx_indexer_mem_limit" type="text" size="4" maxlength="10" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" />' . $this->user->lang['MIB'] . '</dd>
|
<dd><input id="fulltext_sphinx_indexer_mem_limit" type="text" size="4" maxlength="10" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" />' . $this->user->lang['MIB'] . '</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="fulltext_sphinx_config_file">' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '</dt>
|
||||||
|
<dd>' . (($this->config_generate()) ? '<textarea disabled="disabled" rows="6">' . $this->config_file_data . '</textarea>' : $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA')) . '</dd>
|
||||||
|
<dl>
|
||||||
';
|
';
|
||||||
|
|
||||||
// These are fields required in the config table
|
// These are fields required in the config table
|
||||||
|
|
|
@ -85,6 +85,9 @@ $lang = array_merge($lang, array(
|
||||||
'FULLTEXT_SPHINX_WRONG_DATABASE' => 'The sphinx plugin for phpBB currently only supports MySQL',
|
'FULLTEXT_SPHINX_WRONG_DATABASE' => 'The sphinx plugin for phpBB currently only supports MySQL',
|
||||||
'FULLTEXT_SPHINX_STOPWORDS_FILE' => 'Stopwords activated',
|
'FULLTEXT_SPHINX_STOPWORDS_FILE' => 'Stopwords activated',
|
||||||
'FULLTEXT_SPHINX_STOPWORDS_FILE_EXPLAIN' => 'This setting only works with autoconf enabled. You can place a file called sphinx_stopwords.txt containing one word in each line in your config directory. If this file is present these words will be excluded from the indexing process.',
|
'FULLTEXT_SPHINX_STOPWORDS_FILE_EXPLAIN' => 'This setting only works with autoconf enabled. You can place a file called sphinx_stopwords.txt containing one word in each line in your config directory. If this file is present these words will be excluded from the indexing process.',
|
||||||
|
'FULLTEXT_SPHINX_CONFIG_FILE' => 'Sphinx config file',
|
||||||
|
'FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN' => 'The generated content of the sphinx config file. This data needs to be pasted into the sphinx.conf which is used by sphinx search daemon.',
|
||||||
|
'FULLTEXT_SPHINX_NO_CONFIG_DATA' => 'The sphinx data and config directory paths are not defined. Please define them to generate the config file.',
|
||||||
|
|
||||||
'GENERAL_SEARCH_SETTINGS' => 'General search settings',
|
'GENERAL_SEARCH_SETTINGS' => 'General search settings',
|
||||||
'GO_TO_SEARCH_INDEX' => 'Go to search index page',
|
'GO_TO_SEARCH_INDEX' => 'Go to search index page',
|
||||||
|
|
Loading…
Add table
Reference in a new issue