aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhruv Goel <dhruv.goel92@gmail.com>2012-07-10 05:04:14 +0530
committerDhruv <dhruv.goel92@gmail.com>2012-07-19 23:01:28 +0530
commit9711da2763f707408efde160357d51330fd17681 (patch)
treea3515c43b575e0bfa7642e2c96a714b099bac4fc
parentd2e42d7d619100695e0efe8d472c71f61cbfcb45 (diff)
downloadforums-9711da2763f707408efde160357d51330fd17681.tar
forums-9711da2763f707408efde160357d51330fd17681.tar.gz
forums-9711da2763f707408efde160357d51330fd17681.tar.bz2
forums-9711da2763f707408efde160357d51330fd17681.tar.xz
forums-9711da2763f707408efde160357d51330fd17681.zip
[feature/sphinx-fulltext-search] adds default config values
Default config values are added to config table in new install as well as database_update. PHPBB3-10946
-rw-r--r--phpBB/includes/search/fulltext_sphinx.php18
-rw-r--r--phpBB/install/database_update.php10
-rw-r--r--phpBB/install/schemas/schema_data.sql2
3 files changed, 12 insertions, 18 deletions
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php
index 48855ef7d8..36c5c68a3b 100644
--- a/phpBB/includes/search/fulltext_sphinx.php
+++ b/phpBB/includes/search/fulltext_sphinx.php
@@ -742,24 +742,6 @@ class phpbb_search_fulltext_sphinx
'fulltext_sphinx_indexer_mem_limit' => 'int',
);
- $defaults = array(
- 'fulltext_sphinx_indexer_mem_limit' => '512',
- 'fulltext_sphinx_stopwords' => '0',
- );
-
- foreach ($config_vars as $config_var => $type)
- {
- if (!isset($config[$config_var]))
- {
- $default = '';
- if (isset($defaults[$config_var]))
- {
- $default = $defaults[$config_var];
- }
- set_config($config_var, $default);
- }
- }
-
$tpl = '
<span class="error">' . $user->lang['FULLTEXT_SPHINX_CONFIGURE_BEFORE']. '</span>
<dl>
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 594397c815..0ffab8e413 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2260,6 +2260,16 @@ function change_database_data(&$no_updates, $version)
set_config('fulltext_postgres_max_word_len', 254);
}
+ if (!isset($config['fulltext_sphinx_stopwords']))
+ {
+ set_config('fulltext_sphinx_stopwords', 0);
+ }
+
+ if (!isset($config['fulltext_sphinx_indexer_mem_limit']))
+ {
+ set_config('fulltext_sphinx_indexer_mem_limit', 512);
+ }
+
if (!isset($config['load_jquery_cdn']))
{
set_config('load_jquery_cdn', 0);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index deefdafbc4..797f78e889 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -128,6 +128,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_mi
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_max_word_len', '254');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_min_word_len', '4');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_ts_name', 'simple');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_indexer_mem_limit', '512');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_stopwords', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path', 'images/icons');