diff options
| author | Dhruv <dhruv.goel92@gmail.com> | 2012-07-28 18:50:56 +0530 |
|---|---|---|
| committer | Dhruv <dhruv.goel92@gmail.com> | 2012-07-28 18:50:56 +0530 |
| commit | 9eb6c2ba5b6fb1c1090f5a89387a8fa8ae958a85 (patch) | |
| tree | 201648d28e6debfd9832dbcf1768ff56d2615bb2 | |
| parent | d982a37f191ffb731633a6adf6f86416787080db (diff) | |
| download | forums-9eb6c2ba5b6fb1c1090f5a89387a8fa8ae958a85.tar forums-9eb6c2ba5b6fb1c1090f5a89387a8fa8ae958a85.tar.gz forums-9eb6c2ba5b6fb1c1090f5a89387a8fa8ae958a85.tar.bz2 forums-9eb6c2ba5b6fb1c1090f5a89387a8fa8ae958a85.tar.xz forums-9eb6c2ba5b6fb1c1090f5a89387a8fa8ae958a85.zip | |
[ticket/11011] remove global keyword from sphinx
PHPBB3-11011
| -rw-r--r-- | phpBB/includes/search/fulltext_sphinx.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 9dc6e66e3a..0662b70a2b 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -17,13 +17,6 @@ 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.' . $phpEx); - define('SPHINX_MAX_MATCHES', 20000); define('SPHINX_CONNECT_RETRIES', 3); define('SPHINX_CONNECT_WAIT_TIME', 300); @@ -82,6 +75,12 @@ class phpbb_search_fulltext_sphinx $this->id = $this->config['fulltext_sphinx_id']; $this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main'; + if (!class_exists('SphinxClient')) + { + require($this->phpbb_root_path . 'includes/sphinxapi.' . $this->phpEx); + } + + // Initialize sphinx client $this->sphinx = new SphinxClient(); $this->sphinx->SetServer(($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost'), ($this->config['fulltext_sphinx_port'] ? (int) $this->config['fulltext_sphinx_port'] : 9312)); |
