aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2012-07-11 16:25:19 +0530
committerDhruv <dhruv.goel92@gmail.com>2012-07-19 23:01:41 +0530
commit4b40f0d3c6d14adc2b20b866cbeb42586cf8d874 (patch)
tree049ba647244ca30f2758a1bca51926ca4c019617 /phpBB/includes
parentb16e70ae1d03587c7d7d7e106299a4e576491751 (diff)
downloadforums-4b40f0d3c6d14adc2b20b866cbeb42586cf8d874.tar
forums-4b40f0d3c6d14adc2b20b866cbeb42586cf8d874.tar.gz
forums-4b40f0d3c6d14adc2b20b866cbeb42586cf8d874.tar.bz2
forums-4b40f0d3c6d14adc2b20b866cbeb42586cf8d874.tar.xz
forums-4b40f0d3c6d14adc2b20b866cbeb42586cf8d874.zip
[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
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/search/fulltext_sphinx.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php
index 6488cbcd40..6e554eec00 100644
--- a/phpBB/includes/search/fulltext_sphinx.php
+++ b/phpBB/includes/search/fulltext_sphinx.php
@@ -112,11 +112,6 @@ class phpbb_search_fulltext_sphinx
return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE'];
}
- if ($error = $this->config_updated())
- {
- return $error;
- }
-
// Move delta to main index each hour
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
*/
- function config_updated()
+ function config_generate()
{
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);
/* 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();
- 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>
<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>
+ <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