diff options
| author | Dhruv Goel <dhruv.goel92@gmail.com> | 2012-05-09 19:13:36 +0530 |
|---|---|---|
| committer | Dhruv <dhruv.goel92@gmail.com> | 2012-07-12 17:27:23 +0530 |
| commit | fcf0d04b20f1c862117a8ab962d692bd2b8b074f (patch) | |
| tree | 3a8fce9ca275b757b4bbfd028bf8e30b27a516b0 /phpBB/includes | |
| parent | a50b0faf4abfb1bba68e03d843c58f07f842cf12 (diff) | |
| download | forums-fcf0d04b20f1c862117a8ab962d692bd2b8b074f.tar forums-fcf0d04b20f1c862117a8ab962d692bd2b8b074f.tar.gz forums-fcf0d04b20f1c862117a8ab962d692bd2b8b074f.tar.bz2 forums-fcf0d04b20f1c862117a8ab962d692bd2b8b074f.tar.xz forums-fcf0d04b20f1c862117a8ab962d692bd2b8b074f.zip | |
[feature/sphinx-fulltext-search] minor changes
some minor code changes to make it working against current develop
and comply with other search backend coding convetions.
PHPBB3-10946
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/search/fulltext_sphinx.php | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index e0c467df93..ef357970a0 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -18,33 +18,27 @@ if (!defined('IN_PHPBB')) /** * @ignore */ +/** +* This statement is necessary as this file is sometimes included from within a +* function and the variables used are in global space. +*/ +global $phpbb_root_path, $phpEx, $table_prefix; require($phpbb_root_path . "includes/sphinxapi-0.9.8." . $phpEx); define('INDEXER_NAME', 'indexer'); define('SEARCHD_NAME', 'searchd'); -define('SPHINX_TABLE', table_prefix() . 'sphinx'); +define('SPHINX_TABLE', $table_prefix . 'sphinx'); define('MAX_MATCHES', 20000); define('CONNECT_RETRIES', 3); define('CONNECT_WAIT_TIME', 300); /** -* Returns the global table prefix -* This function is necessary as this file is sometimes included from within a -* function and table_prefix is in global space. -*/ -function table_prefix() -{ - global $table_prefix; - return $table_prefix; -} - -/** * fulltext_sphinx * Fulltext search based on the sphinx search deamon * @package search */ -class fulltext_sphinx +class phpbb_search_fulltext_sphinx { var $stats = array(); var $word_length = array(); @@ -53,7 +47,7 @@ class fulltext_sphinx var $common_words = array(); var $id; - function fulltext_sphinx(&$error) + public function __construct(&$error) { global $config; @@ -82,6 +76,16 @@ class fulltext_sphinx $error = false; } + + /** + * Returns the name of this search backend to be displayed to administrators + * + * @return string Name + */ + public function get_name() + { + return 'Sphinx Fulltext'; + } /** * Checks permissions and paths, if everything is correct it generates the config file |
