From 26a9ccab59ca1e1463778b169911a024acbd4736 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 10 Aug 2012 16:00:51 +0530 Subject: [PATCH 01/18] [ticket/11050] add access specifiers to pgsql search properties PHPBB3-11050 --- phpBB/includes/search/fulltext_postgres.php | 64 ++++++++++++++++++++- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 38989a9d9a..ab4864bacc 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -22,18 +22,76 @@ if (!defined('IN_PHPBB')) */ class phpbb_search_fulltext_postgres extends phpbb_search_base { + /** + * Associative array holding index stats + * @var array + */ protected $stats = array(); + + /** + * Holds the words entered by user splitted in array + * @var array + */ protected $split_words = array(); + + /** + * True if postgresql version supports tsearch + * @var boolean + */ protected $tsearch_usable = false; + + /** + * Stores the PostgreSQL version + * @var string + */ protected $version; + + /** + * Stores the tsearch query + * @var string + */ protected $tsearch_query; + + /** + * True if phrase search is supported. + * postgreSQL fulltext currently doesn't support it + * @var boolean + */ protected $phrase_search = false; + + /** + * @var phpbb_config Config class object + */ protected $config; + + /** + * @var dbal DBAL class object + */ protected $db; + + /** + * @var user User class object + */ protected $user; - protected $search_query; - protected $common_words = array(); - protected $word_length = array(); + + /** + * Contains tidied search query + * @var string + */ + public $search_query; + + /** + * Contains common words + * common words are words with length less/more than min/max length + * @var array + */ + public $common_words = array(); + + /** + * Associative array stores the min and max length + * @var array + */ + public $word_length = array(); /** * Constructor From db9351d0f6f1baa2184cfef284317b62f5ba52a6 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 10 Aug 2012 16:07:24 +0530 Subject: [PATCH 02/18] [ticket/11050] add access specifiers to mysql search properties PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 43 ++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 7cd06dee19..a1c9101bc1 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -22,14 +22,51 @@ if (!defined('IN_PHPBB')) */ class phpbb_search_fulltext_mysql extends phpbb_search_base { + /** + * Associative array holding index stats + * @var array + */ protected $stats = array(); + + /** + * Holds the words entered by user splitted in array + * @var array + */ protected $split_words = array(); + + /** + * @var phpbb_config Config class object + */ protected $config; + + /** + * @var dbal DBAL class object + */ protected $db; + + /** + * @var user User class object + */ protected $user; - protected $word_length = array(); - protected $search_query; - protected $common_words = array(); + + /** + * Associative array stores the min and max length + * @var array + */ + public $word_length = array(); + + /** + * Contains tidied search query + * @var string + */ + public $search_query; + + /** + * Contains common words + * common words are words with length less/more than min/max length + * @var array + */ + public $common_words = array(); /** * Constructor From 505a7133490450015c7d5e35fe7ca0d2da338d3c Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 10 Aug 2012 16:26:57 +0530 Subject: [PATCH 03/18] [ticket/11050] add access specifiers to sphinx search properties PHPBB3-11050 --- phpBB/includes/search/fulltext_sphinx.php | 77 ++++++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 0a230f0e98..5082e511dc 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -28,22 +28,95 @@ define('SPHINX_CONNECT_WAIT_TIME', 300); */ class phpbb_search_fulltext_sphinx { + /** + * Associative array holding index stats + * @var array + */ protected $stats = array(); + + /** + * Holds the words entered by user splitted in array + * @var array + */ protected $split_words = array(); + + /** + * Holds unique sphinx id + * @var string + */ protected $id; + + /** + * Stores the names of both main and delta sphinx indexes + * seperated by a semicolon + * @var string + */ protected $indexes; + + /** + * Sphinx searchd client class object + * @var SphinxClient + */ protected $sphinx; + + /** + * @var string Relative path to board root + */ protected $phpbb_root_path; + + /** + * @var string PHP Extension + */ protected $php_ext; + + /** + * @var phpbb_auth Auth class object + */ protected $auth; + + /** + * @var phpbb_config Config class object + */ protected $config; + + /** + * @var dbal DBAL class object + */ protected $db; + + /** + * @var phpbb_db_tools Database Tools class object + */ protected $db_tools; + + /** + * Stores the database type if supported by sphinx + * @var string + */ protected $dbtype; + + /** + * @var user User class object + */ protected $user; + + /** + * Stores the generated content of the sphinx config file + */ protected $config_file_data = ''; - protected $search_query; - protected $common_words = array(); + + /** + * Contains tidied search query + * @var string + */ + public $search_query; + + /** + * Contains common words + * common words are words with length less/more than min/max length + * @var array + */ + public $common_words = array(); /** * Constructor From fd20e73b74aab478ec4bc8cfad4a0d42d0740767 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 10 Aug 2012 16:28:38 +0530 Subject: [PATCH 04/18] [ticket/11050] remove common_words property from sphinx common_words property is never used in sphinx class hence removed. PHPBB3-11050 --- phpBB/includes/search/fulltext_sphinx.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 5082e511dc..5324580272 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -111,13 +111,6 @@ class phpbb_search_fulltext_sphinx */ public $search_query; - /** - * Contains common words - * common words are words with length less/more than min/max length - * @var array - */ - public $common_words = array(); - /** * Constructor * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend. From 4172a9d797a707ba728f3d21e8241e74e882c5af Mon Sep 17 00:00:00 2001 From: Dhruv Date: Tue, 14 Aug 2012 17:26:12 +0530 Subject: [PATCH 05/18] [ticket/11050] add missing @var PHPBB3-11050 --- phpBB/includes/search/fulltext_sphinx.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 5324580272..e20231517a 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -102,6 +102,7 @@ class phpbb_search_fulltext_sphinx /** * Stores the generated content of the sphinx config file + * @var string */ protected $config_file_data = ''; From 3dc42c67d3d0870e47ecf98abfa885262bcf962d Mon Sep 17 00:00:00 2001 From: Dhruv Date: Tue, 14 Aug 2012 23:54:46 +0530 Subject: [PATCH 06/18] [ticket/11050] fix docblocks with description before @var PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 9 ++++++--- phpBB/includes/search/fulltext_postgres.php | 9 ++++++--- phpBB/includes/search/fulltext_sphinx.php | 21 ++++++++++++++------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index a1c9101bc1..98df301082 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -35,17 +35,20 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base protected $split_words = array(); /** - * @var phpbb_config Config class object + * Config class object + * @var phpbb_config */ protected $config; /** - * @var dbal DBAL class object + * DBAL class object + * @var dbal */ protected $db; /** - * @var user User class object + * User class object + * @var user */ protected $user; diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index ab4864bacc..a41307a3a4 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -60,17 +60,20 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $phrase_search = false; /** - * @var phpbb_config Config class object + * Config class object + * @var phpbb_config */ protected $config; /** - * @var dbal DBAL class object + * DBAL class object + * @var dbal */ protected $db; /** - * @var user User class object + * User class object + * @var user */ protected $user; diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index e20231517a..20752df1c2 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -60,32 +60,38 @@ class phpbb_search_fulltext_sphinx protected $sphinx; /** - * @var string Relative path to board root + * Relative path to board root + * @var string */ protected $phpbb_root_path; /** - * @var string PHP Extension + * PHP Extension + * @var string */ protected $php_ext; /** - * @var phpbb_auth Auth class object + * Auth class object + * @var phpbb_auth */ protected $auth; /** - * @var phpbb_config Config class object + * Config class object + * @var phpbb_config */ protected $config; /** - * @var dbal DBAL class object + * DBAL class object + * @var dbal */ protected $db; /** - * @var phpbb_db_tools Database Tools class object + * Database Tools class object + * @var phpbb_db_tools */ protected $db_tools; @@ -96,7 +102,8 @@ class phpbb_search_fulltext_sphinx protected $dbtype; /** - * @var user User class object + * User class object + * @var user */ protected $user; From 5a7ed3c56706f75dfe6180d17cb78557d00ed781 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 15 Aug 2012 12:04:55 +0530 Subject: [PATCH 07/18] [ticket/11050] add access specifiers to native search properties PHPBB3-11050 --- phpBB/includes/search/fulltext_native.php | 61 +++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index bc4ac4bbe0..6a21a5699d 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -22,19 +22,74 @@ if (!defined('IN_PHPBB')) */ class phpbb_search_fulltext_native extends phpbb_search_base { + /** + * Associative array holding index stats + * @var array + */ protected $stats = array(); - protected $word_length = array(); - protected $search_query; - protected $common_words = array(); + /** + * Associative array stores the min and max length + * @var array + */ + public $word_length = array(); + + /** + * Contains tidied search query + * @var string + */ + public $search_query; + + /** + * Contains common words + * common words are words with length less/more than min/max length + * @var array + */ + public $common_words = array(); + + /** + * Post ids of posts containing words that are to be included + */ protected $must_contain_ids = array(); + + /** + * Post ids of posts containing words that should not be included + */ protected $must_not_contain_ids = array(); + + /** + * Post ids of posts containing atleast one word that needs to be excluded + */ protected $must_exclude_one_ids = array(); + /** + * Relative path to board root + * @var string + */ protected $phpbb_root_path; + + /** + * PHP Extension + * @var string + */ protected $php_ext; + + /** + * Config class object + * @var phpbb_config + */ protected $config; + + /** + * DBAL class object + * @var dbal + */ protected $db; + + /** + * User class object + * @var user + */ protected $user; /** From 56395ea3597ee7a487444ebd6e6d6c237a5a328a Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 15 Aug 2012 23:49:51 +0530 Subject: [PATCH 08/18] [ticket/11050] fix minor comment/docblocks issues No comments should end with a period. All occurences like PostgreSQL should have proper case. PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 10 +++++----- phpBB/includes/search/fulltext_native.php | 14 +++++++------- phpBB/includes/search/fulltext_postgres.php | 16 ++++++++-------- phpBB/includes/search/fulltext_sphinx.php | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 98df301082..c84a608763 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -73,7 +73,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Constructor - * Creates a new phpbb_search_fulltext_mysql, which is used as a search backend. + * Creates a new phpbb_search_fulltext_mysql, which is used as a search backend * * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false */ @@ -325,7 +325,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } /** - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first. + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first * * @param string $type contains either posts or topics depending on what should be searched for * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) @@ -346,7 +346,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base */ public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page) { - // No keywords? No posts. + // No keywords? No posts if (!$this->search_query) { return false; @@ -526,7 +526,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base */ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page) { - // No author? No posts. + // No author? No posts if (!sizeof($author_ary)) { return 0; @@ -675,7 +675,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base } /** - * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated. + * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated * * @param string $mode contains the post mode: edit, post, reply, quote ... * @param int $post_id contains the post id of the post to index diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 6a21a5699d..4c09160817 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -93,9 +93,9 @@ class phpbb_search_fulltext_native extends phpbb_search_base protected $user; /** - * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded. + * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded * - * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure. + * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure */ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user) { @@ -163,14 +163,14 @@ class phpbb_search_fulltext_native extends phpbb_search_base } /** - * This function fills $this->search_query with the cleaned user search query. + * This function fills $this->search_query with the cleaned user search query * * If $terms is 'any' then the words will be extracted from the search query * and combined with | inside brackets. They will afterwards be treated like * an standard search query. * * Then it analyses the query and fills the internal arrays $must_not_contain_ids, - * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search(). + * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search() * * @param string $keywords contains the search query string as entered by the user * @param string $terms is either 'all' (use search query as entered, default words to 'must be contained in post') @@ -493,7 +493,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base } /** - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first. + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first * * @param string $type contains either posts or topics depending on what should be searched for * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) @@ -859,7 +859,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base // if we use mysql and the total result count is not cached yet, retrieve it from the db if (!$total_results && $is_mysql) { - // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it. + // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it $sql_array_copy = $sql_array; $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id '; @@ -908,7 +908,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base */ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page) { - // No author? No posts. + // No author? No posts if (!sizeof($author_ary)) { return 0; diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index a41307a3a4..6d6e6851c8 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -35,7 +35,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $split_words = array(); /** - * True if postgresql version supports tsearch + * True if PostgreSQL version supports tsearch * @var boolean */ protected $tsearch_usable = false; @@ -53,8 +53,8 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $tsearch_query; /** - * True if phrase search is supported. - * postgreSQL fulltext currently doesn't support it + * True if phrase search is supported + * PostgreSQL fulltext currently doesn't support it * @var boolean */ protected $phrase_search = false; @@ -98,7 +98,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base /** * Constructor - * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend. + * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend * * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false */ @@ -315,7 +315,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base } /** - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first. + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first * * @param string $type contains either posts or topics depending on what should be searched for * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) @@ -336,7 +336,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base */ public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page) { - // No keywords? No posts. + // No keywords? No posts if (!$this->search_query) { return false; @@ -520,7 +520,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base */ public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page) { - // No author? No posts. + // No author? No posts if (!sizeof($author_ary)) { return 0; @@ -663,7 +663,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base } /** - * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated. + * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated * * @param string $mode contains the post mode: edit, post, reply, quote ... * @param int $post_id contains the post id of the post to index diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 20752df1c2..0cb7bd35a5 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -121,7 +121,7 @@ class phpbb_search_fulltext_sphinx /** * Constructor - * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend. + * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend * * @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false */ @@ -434,7 +434,7 @@ class phpbb_search_fulltext_sphinx } /** - * Performs a search on keywords depending on display specific params. You have to run split_keywords() first. + * Performs a search on keywords depending on display specific params. You have to run split_keywords() first * * @param string $type contains either posts or topics depending on what should be searched for * @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched) From 8eed3591a9019cf8a377b7690130c1d466aa3ea2 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Thu, 16 Aug 2012 00:07:11 +0530 Subject: [PATCH 09/18] [ticket/11050] replace user by phpbb_user PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 2 +- phpBB/includes/search/fulltext_native.php | 2 +- phpBB/includes/search/fulltext_postgres.php | 2 +- phpBB/includes/search/fulltext_sphinx.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index c84a608763..25d9d47dc6 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -48,7 +48,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * User class object - * @var user + * @var phpbb_user */ protected $user; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 4c09160817..8f413bcaaf 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -88,7 +88,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * User class object - * @var user + * @var phpbb_user */ protected $user; diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 6d6e6851c8..cba281777f 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -73,7 +73,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base /** * User class object - * @var user + * @var phpbb_user */ protected $user; diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 0cb7bd35a5..5ff9deef3b 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -103,7 +103,7 @@ class phpbb_search_fulltext_sphinx /** * User class object - * @var user + * @var phpbb_user */ protected $user; From 1ded6d94ac3ce2035f41cb0d32137e5a0deb7c8c Mon Sep 17 00:00:00 2001 From: Dhruv Date: Thu, 16 Aug 2012 00:09:35 +0530 Subject: [PATCH 10/18] [ticket/11050] add missing @var in native search PHPBB3-11050 --- phpBB/includes/search/fulltext_native.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 8f413bcaaf..729ec17a75 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -49,16 +49,19 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Post ids of posts containing words that are to be included + * @var array */ protected $must_contain_ids = array(); /** * Post ids of posts containing words that should not be included + * @var array */ protected $must_not_contain_ids = array(); /** * Post ids of posts containing atleast one word that needs to be excluded + * @var array */ protected $must_exclude_one_ids = array(); From b7dae379d53a81a1197e703aced19a6206985054 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 19 Aug 2012 12:07:06 +0530 Subject: [PATCH 11/18] [ticket/11050] remove class word from docblocks PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 6 +++--- phpBB/includes/search/fulltext_native.php | 6 +++--- phpBB/includes/search/fulltext_postgres.php | 6 +++--- phpBB/includes/search/fulltext_sphinx.php | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 25d9d47dc6..608392fc15 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -35,19 +35,19 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base protected $split_words = array(); /** - * Config class object + * Config object * @var phpbb_config */ protected $config; /** - * DBAL class object + * DBAL object * @var dbal */ protected $db; /** - * User class object + * User object * @var phpbb_user */ protected $user; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 729ec17a75..7c778c890a 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -78,19 +78,19 @@ class phpbb_search_fulltext_native extends phpbb_search_base protected $php_ext; /** - * Config class object + * Config object * @var phpbb_config */ protected $config; /** - * DBAL class object + * DBAL object * @var dbal */ protected $db; /** - * User class object + * User object * @var phpbb_user */ protected $user; diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index cba281777f..414b75f0f1 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -60,19 +60,19 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $phrase_search = false; /** - * Config class object + * Config object * @var phpbb_config */ protected $config; /** - * DBAL class object + * DBAL object * @var dbal */ protected $db; /** - * User class object + * User object * @var phpbb_user */ protected $user; diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 5ff9deef3b..ac42c8d208 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -54,7 +54,7 @@ class phpbb_search_fulltext_sphinx protected $indexes; /** - * Sphinx searchd client class object + * Sphinx searchd client object * @var SphinxClient */ protected $sphinx; @@ -72,25 +72,25 @@ class phpbb_search_fulltext_sphinx protected $php_ext; /** - * Auth class object + * Auth object * @var phpbb_auth */ protected $auth; /** - * Config class object + * Config object * @var phpbb_config */ protected $config; /** - * DBAL class object + * DBAL object * @var dbal */ protected $db; /** - * Database Tools class object + * Database Tools object * @var phpbb_db_tools */ protected $db_tools; @@ -102,7 +102,7 @@ class phpbb_search_fulltext_sphinx protected $dbtype; /** - * User class object + * User object * @var phpbb_user */ protected $user; From 6ae64f1c1e37ff2b4de488d6f5264e581b0ac6cf Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 19 Aug 2012 13:04:34 +0530 Subject: [PATCH 12/18] [ticket/11050] fix split words doc block language PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 2 +- phpBB/includes/search/fulltext_postgres.php | 2 +- phpBB/includes/search/fulltext_sphinx.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 608392fc15..3edf732b74 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -29,7 +29,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base protected $stats = array(); /** - * Holds the words entered by user splitted in array + * Holds the words entered by user, obtained by splitting the entered query on whitespace * @var array */ protected $split_words = array(); diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 414b75f0f1..7863d070d4 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -29,7 +29,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $stats = array(); /** - * Holds the words entered by user splitted in array + * Holds the words entered by user, obtained by splitting the entered query on whitespace * @var array */ protected $split_words = array(); diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index ac42c8d208..e52be6a0b7 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -35,7 +35,7 @@ class phpbb_search_fulltext_sphinx protected $stats = array(); /** - * Holds the words entered by user splitted in array + * Holds the words entered by user, obtained by splitting the entered query on whitespace * @var array */ protected $split_words = array(); From 5a2cbc241757fc5995419de52910f9067585e068 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 19 Aug 2012 13:08:28 +0530 Subject: [PATCH 13/18] [ticket/11050] fix separated spelling in docblock PHPBB3-11050 --- phpBB/includes/search/fulltext_sphinx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index e52be6a0b7..ceb6b0a7aa 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -48,7 +48,7 @@ class phpbb_search_fulltext_sphinx /** * Stores the names of both main and delta sphinx indexes - * seperated by a semicolon + * separated by a semicolon * @var string */ protected $indexes; From 7c3cbc07cf708865a8ab45547e5a8e70bb82196d Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 19 Aug 2012 13:13:03 +0530 Subject: [PATCH 14/18] [ticket/11050] multi sentences separated by period in docblocks Starting of each sentence should be capitalized. PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 4 ++-- phpBB/includes/search/fulltext_native.php | 4 ++-- phpBB/includes/search/fulltext_postgres.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 3edf732b74..2b136f3f79 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -65,8 +65,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base public $search_query; /** - * Contains common words - * common words are words with length less/more than min/max length + * Contains common words. + * Common words are words with length less/more than min/max length * @var array */ public $common_words = array(); diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 7c778c890a..d7c9b009dd 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -41,8 +41,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base public $search_query; /** - * Contains common words - * common words are words with length less/more than min/max length + * Contains common words. + * Common words are words with length less/more than min/max length * @var array */ public $common_words = array(); diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 7863d070d4..205a053451 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -53,7 +53,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $tsearch_query; /** - * True if phrase search is supported + * True if phrase search is supported. * PostgreSQL fulltext currently doesn't support it * @var boolean */ @@ -84,8 +84,8 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base public $search_query; /** - * Contains common words - * common words are words with length less/more than min/max length + * Contains common words. + * Common words are words with length less/more than min/max length * @var array */ public $common_words = array(); From 0556959a6af3868fe17093840a46340105483759 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Mon, 20 Aug 2012 00:58:41 +0530 Subject: [PATCH 15/18] [ticket/11050] fix min/max length docblock language PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 2 +- phpBB/includes/search/fulltext_native.php | 2 +- phpBB/includes/search/fulltext_postgres.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 2b136f3f79..0cd0f99695 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -53,7 +53,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base protected $user; /** - * Associative array stores the min and max length + * Associative array stores the min and max word length to be searched * @var array */ public $word_length = array(); diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index d7c9b009dd..5aa718a6e6 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -29,7 +29,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base protected $stats = array(); /** - * Associative array stores the min and max length + * Associative array stores the min and max word length to be searched * @var array */ public $word_length = array(); diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 205a053451..50546edec3 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -91,7 +91,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base public $common_words = array(); /** - * Associative array stores the min and max length + * Associative array stores the min and max word length to be searched * @var array */ public $word_length = array(); From 72245e41d0df20ec30967d12836170a07bf5b427 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Mon, 20 Aug 2012 01:04:43 +0530 Subject: [PATCH 16/18] [ticket/11050] fix tidied search query docblock language PHPBB3-11050 --- phpBB/includes/search/fulltext_mysql.php | 3 ++- phpBB/includes/search/fulltext_native.php | 3 ++- phpBB/includes/search/fulltext_postgres.php | 3 ++- phpBB/includes/search/fulltext_sphinx.php | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 0cd0f99695..2084864e4d 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -59,7 +59,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base public $word_length = array(); /** - * Contains tidied search query + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded * @var string */ public $search_query; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 5aa718a6e6..14d4c60134 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -35,7 +35,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base public $word_length = array(); /** - * Contains tidied search query + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded * @var string */ public $search_query; diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 50546edec3..98bf010c93 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -78,7 +78,8 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base protected $user; /** - * Contains tidied search query + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded * @var string */ public $search_query; diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index ceb6b0a7aa..2f6be20703 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -114,7 +114,8 @@ class phpbb_search_fulltext_sphinx protected $config_file_data = ''; /** - * Contains tidied search query + * Contains tidied search query. + * Operators are prefixed in search query and common words excluded * @var string */ public $search_query; From c5c9bc5ada9bcfdc0a1502b2b64d3fa394f37814 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 9 Nov 2012 16:08:32 +0530 Subject: [PATCH 17/18] [ticket/11050] get_common_words() returns empty array for sphinx PHPBB-11050 --- phpBB/includes/search/fulltext_sphinx.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 2f6be20703..37e9240c7b 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -194,13 +194,13 @@ class phpbb_search_fulltext_sphinx } /** - * Returns the common_words array + * Returns an empty array as there are no common_words * * @return array common words that are ignored by search backend */ public function get_common_words() { - return $this->common_words; + return array(); } /** From a509a8ed2d921d4797e08531e70ba70afb167d9d Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 9 Nov 2012 16:22:32 +0530 Subject: [PATCH 18/18] [ticket/11050] make all properties protected in all search backends PHPBB-11050 --- phpBB/includes/search/fulltext_mysql.php | 6 +++--- phpBB/includes/search/fulltext_native.php | 6 +++--- phpBB/includes/search/fulltext_postgres.php | 6 +++--- phpBB/includes/search/fulltext_sphinx.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 2084864e4d..700b8695dc 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -56,21 +56,21 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base * Associative array stores the min and max word length to be searched * @var array */ - public $word_length = array(); + protected $word_length = array(); /** * Contains tidied search query. * Operators are prefixed in search query and common words excluded * @var string */ - public $search_query; + protected $search_query; /** * Contains common words. * Common words are words with length less/more than min/max length * @var array */ - public $common_words = array(); + protected $common_words = array(); /** * Constructor diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 14d4c60134..e25b1fe11d 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -32,21 +32,21 @@ class phpbb_search_fulltext_native extends phpbb_search_base * Associative array stores the min and max word length to be searched * @var array */ - public $word_length = array(); + protected $word_length = array(); /** * Contains tidied search query. * Operators are prefixed in search query and common words excluded * @var string */ - public $search_query; + protected $search_query; /** * Contains common words. * Common words are words with length less/more than min/max length * @var array */ - public $common_words = array(); + protected $common_words = array(); /** * Post ids of posts containing words that are to be included diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 98bf010c93..12a1203249 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -82,20 +82,20 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base * Operators are prefixed in search query and common words excluded * @var string */ - public $search_query; + protected $search_query; /** * Contains common words. * Common words are words with length less/more than min/max length * @var array */ - public $common_words = array(); + protected $common_words = array(); /** * Associative array stores the min and max word length to be searched * @var array */ - public $word_length = array(); + protected $word_length = array(); /** * Constructor diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 37e9240c7b..674029fe6c 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -118,7 +118,7 @@ class phpbb_search_fulltext_sphinx * Operators are prefixed in search query and common words excluded * @var string */ - public $search_query; + protected $search_query; /** * Constructor