diff options
Diffstat (limited to 'phpBB/phpbb/search')
-rw-r--r-- | phpBB/phpbb/search/fulltext_mysql.php | 25 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_native.php | 12 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_postgres.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_sphinx.php | 8 |
4 files changed, 19 insertions, 28 deletions
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index 1105d0892f..42ac6eaba2 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -83,7 +83,7 @@ class fulltext_mysql extends \phpbb\search\base * @param string $phpEx PHP file extension * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\config\config $config Config object - * @param \phpbb\db\driver\driver_interface Database object + * @param \phpbb\db\driver\driver_interface $db Database object * @param \phpbb\user $user User object * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object */ @@ -150,11 +150,11 @@ class fulltext_mysql extends \phpbb\search\base /** * Checks for correct MySQL version and stores min/max word length in the config * - * @return string|bool Language key of the error/incompatiblity occurred + * @return string|bool Language key of the error/incompatibility occurred */ public function init() { - if ($this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli') + if ($this->db->get_sql_layer() != 'mysqli') { return $this->user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE']; } @@ -1005,14 +1005,7 @@ class fulltext_mysql extends \phpbb\search\base if (!isset($this->stats['post_subject'])) { $alter_entry = array(); - if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) - { - $alter_entry[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; - } - else - { - $alter_entry[] = 'MODIFY post_subject text NOT NULL'; - } + $alter_entry[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; $alter_entry[] = 'ADD FULLTEXT (post_subject)'; $alter_list[] = $alter_entry; } @@ -1020,15 +1013,7 @@ class fulltext_mysql extends \phpbb\search\base if (!isset($this->stats['post_content'])) { $alter_entry = array(); - if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>=')) - { - $alter_entry[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; - } - else - { - $alter_entry[] = 'MODIFY post_text mediumtext NOT NULL'; - } - + $alter_entry[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; $alter_entry[] = 'ADD FULLTEXT post_content (post_text, post_subject)'; $alter_list[] = $alter_entry; } diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index c83de75eed..23460d3381 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -109,6 +109,12 @@ class fulltext_native extends \phpbb\search\base * Initialises the fulltext_native search backend with min/max word length * * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure + * @param string $phpbb_root_path phpBB root path + * @param string $phpEx PHP file extension + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config Config object + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\user $user User object * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object */ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher) @@ -351,7 +357,7 @@ class fulltext_native extends \phpbb\search\base $this->db->sql_freeresult($result); } - // Handle +, - without preceeding whitespace character + // Handle +, - without preceding whitespace character $match = array('#(\S)\+#', '#(\S)-#'); $replace = array('$1 +', '$1 +'); @@ -782,6 +788,8 @@ class fulltext_native extends \phpbb\search\base $must_not_contain_ids = $this->must_not_contain_ids; $must_contain_ids = $this->must_contain_ids; + $sql_sort_table = $sql_sort_join = $sql_match = $sql_match_where = $sql_sort = ''; + /** * Allow changing the query used for counting for posts using fulltext_native * @@ -889,7 +897,6 @@ class fulltext_native extends \phpbb\search\base switch ($this->db->get_sql_layer()) { - case 'mysql4': case 'mysqli': // 3.x does not support SQL_CALC_FOUND_ROWS @@ -1184,7 +1191,6 @@ class fulltext_native extends \phpbb\search\base { switch ($this->db->get_sql_layer()) { - case 'mysql4': case 'mysqli': // $select = 'SQL_CALC_FOUND_ROWS ' . $select; $is_mysql = true; diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 2f387e791e..6241f21fcf 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -173,7 +173,7 @@ class fulltext_postgres extends \phpbb\search\base /** * Checks for correct PostgreSQL version and stores min/max word length in the config * - * @return string|bool Language key of the error/incompatiblity occurred + * @return string|bool Language key of the error/incompatibility occurred */ public function init() { diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 227fbd3fd6..d2e12fd7c0 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -18,7 +18,7 @@ define('SPHINX_CONNECT_RETRIES', 3); define('SPHINX_CONNECT_WAIT_TIME', 300); /** -* Fulltext search based on the sphinx search deamon +* Fulltext search based on the sphinx search daemon */ class fulltext_sphinx { @@ -210,11 +210,11 @@ class fulltext_sphinx /** * Checks permissions and paths, if everything is correct it generates the config file * - * @return string|bool Language key of the error/incompatiblity encountered, or false if successful + * @return string|bool Language key of the error/incompatibility encountered, or false if successful */ public function init() { - if ($this->db->get_sql_layer() != 'mysql' && $this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli' && $this->db->get_sql_layer() != 'postgres') + if ($this->db->get_sql_layer() != 'mysqli' && $this->db->get_sql_layer() != 'postgres') { return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE']; } @@ -233,7 +233,7 @@ class fulltext_sphinx protected function config_generate() { // Check if Database is supported by Sphinx - if ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli') + if ($this->db->get_sql_layer() == 'mysqli') { $this->dbtype = 'mysql'; } |