From db1c80dee9c923326683252d70b6712c8432673a Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 21 Jul 2012 17:38:28 +0530 Subject: [PATCH] [ticket/11011] add access specifiers and docblocks Add access specifiers and docblocks to mysql search backend. PHPBB3-11011 --- phpBB/includes/search/fulltext_mysql.php | 61 +++++++++++++++++++++--- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 20dcb74c0d..64b3feb30c 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -22,12 +22,18 @@ if (!defined('IN_PHPBB')) */ class phpbb_search_fulltext_mysql extends phpbb_search_base { - var $stats = array(); - var $word_length = array(); - var $split_words = array(); - var $search_query; - var $common_words = array(); + private $stats = array(); + private $split_words = array(); + public $word_length = array(); + public $search_query; + public $common_words = array(); + /** + * Constructor + * 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 + */ public function __construct(&$error) { global $config; @@ -41,6 +47,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base * Returns the name of this search backend to be displayed to administrators * * @return string Name + * + * @access public */ public function get_name() { @@ -49,6 +57,10 @@ class phpbb_search_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 occured + * + * @access public */ function init() { @@ -102,6 +114,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base * @param string &$keywords Contains the keyword as entered by the user * @param string $terms is either 'all' or 'any' * @return bool false if no valid keywords were found and otherwise true + * + * @access public */ function split_keywords(&$keywords, $terms) { @@ -221,6 +235,9 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Turns text into an array of words + * @param string $text contains post text/subject + * + * @access public */ function split_message($text) { @@ -607,7 +624,14 @@ 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. * - * @param string $mode contains the post mode: edit, post, reply, quote ... + * @param string $mode contains the post mode: edit, post, reply, quote ... + * @param int $post_id contains the post id of the post to index + * @param string $message contains the post text of the post + * @param string $subject contains the subject of the post to index + * @param int $poster_id contains the user id of the poster + * @param int $forum_id contains the forum id of parent forum of the post + * + * @access public */ function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { @@ -630,6 +654,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Destroy cached results, that might be outdated after deleting a post + * + * @access public */ function index_remove($post_ids, $author_ids, $forum_ids) { @@ -638,6 +664,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Destroy old cache entries + * + * @access public */ function tidy() { @@ -651,6 +679,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Create fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false + * + * @access public */ function create_index($acp_module, $u_action) { @@ -712,6 +744,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Drop fulltext index + * + * @return string|bool error string is returned incase of errors otherwise false + * + * @access public */ function delete_index($acp_module, $u_action) { @@ -757,6 +793,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Returns true if both FULLTEXT indexes exist + * + * @access public */ function index_created() { @@ -770,6 +808,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Returns an associative array containing information about the indexes + * + * @access public */ function index_stats() { @@ -785,6 +825,11 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base ); } + /** + * Computes the stats and store them in the $this->stats associative array + * + * @access private + */ function get_stats() { global $db; @@ -827,6 +872,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Display a note, that UTF-8 support is not available with certain versions of PHP + * + * @return associative array containing template and config variables + * + * @access public */ function acp() {