mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 06:55:25 +02:00
[ticket/11011] add access specifiers and docblocks
Add access specifiers and docblocks to mysql search backend. PHPBB3-11011
This commit is contained in:
parent
7fd1a166da
commit
db1c80dee9
@ -22,12 +22,18 @@ if (!defined('IN_PHPBB'))
|
|||||||
*/
|
*/
|
||||||
class phpbb_search_fulltext_mysql extends phpbb_search_base
|
class phpbb_search_fulltext_mysql extends phpbb_search_base
|
||||||
{
|
{
|
||||||
var $stats = array();
|
private $stats = array();
|
||||||
var $word_length = array();
|
private $split_words = array();
|
||||||
var $split_words = array();
|
public $word_length = array();
|
||||||
var $search_query;
|
public $search_query;
|
||||||
var $common_words = array();
|
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)
|
public function __construct(&$error)
|
||||||
{
|
{
|
||||||
global $config;
|
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
|
* Returns the name of this search backend to be displayed to administrators
|
||||||
*
|
*
|
||||||
* @return string Name
|
* @return string Name
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function get_name()
|
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
|
* 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()
|
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 &$keywords Contains the keyword as entered by the user
|
||||||
* @param string $terms is either 'all' or 'any'
|
* @param string $terms is either 'all' or 'any'
|
||||||
* @return bool false if no valid keywords were found and otherwise true
|
* @return bool false if no valid keywords were found and otherwise true
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function split_keywords(&$keywords, $terms)
|
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
|
* Turns text into an array of words
|
||||||
|
* @param string $text contains post text/subject
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function split_message($text)
|
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.
|
* 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)
|
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
|
* Destroy cached results, that might be outdated after deleting a post
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index_remove($post_ids, $author_ids, $forum_ids)
|
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
|
* Destroy old cache entries
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function tidy()
|
function tidy()
|
||||||
{
|
{
|
||||||
@ -651,6 +679,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create fulltext index
|
* Create fulltext index
|
||||||
|
*
|
||||||
|
* @return string|bool error string is returned incase of errors otherwise false
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function create_index($acp_module, $u_action)
|
function create_index($acp_module, $u_action)
|
||||||
{
|
{
|
||||||
@ -712,6 +744,10 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Drop fulltext index
|
* Drop fulltext index
|
||||||
|
*
|
||||||
|
* @return string|bool error string is returned incase of errors otherwise false
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function delete_index($acp_module, $u_action)
|
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
|
* Returns true if both FULLTEXT indexes exist
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index_created()
|
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
|
* Returns an associative array containing information about the indexes
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index_stats()
|
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()
|
function get_stats()
|
||||||
{
|
{
|
||||||
global $db;
|
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
|
* 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()
|
function acp()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user