mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00:00
[feature/sphinx-fulltext-search] add docblock and access modifiers
PHPBB3-10946 Conflicts: phpBB/includes/search/fulltext_sphinx.php
This commit is contained in:
parent
2503581cd5
commit
8dcdf8a973
1 changed files with 70 additions and 15 deletions
|
@ -38,15 +38,21 @@ define('CONNECT_WAIT_TIME', 300);
|
||||||
*/
|
*/
|
||||||
class phpbb_search_fulltext_sphinx
|
class phpbb_search_fulltext_sphinx
|
||||||
{
|
{
|
||||||
var $stats = array();
|
private $stats = array();
|
||||||
var $word_length = array();
|
private $split_words = array();
|
||||||
var $split_words = array();
|
private $id;
|
||||||
var $search_query;
|
private $indexes;
|
||||||
var $common_words = array();
|
private $sphinx;
|
||||||
var $id;
|
public $word_length = array();
|
||||||
var $indexes;
|
public $search_query;
|
||||||
var $sphinx;
|
public $common_words = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
public function __construct(&$error)
|
public function __construct(&$error)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
@ -81,6 +87,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
* 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()
|
||||||
{
|
{
|
||||||
|
@ -89,6 +97,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks permissions and paths, if everything is correct it generates the config file
|
* Checks permissions and paths, if everything is correct it generates the config file
|
||||||
|
*
|
||||||
|
* @return string|bool Language key of the error/incompatiblity occured
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
|
@ -110,6 +122,13 @@ class phpbb_search_fulltext_sphinx
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the config file sphinx.conf and generates the same in case autoconf is selected
|
||||||
|
*
|
||||||
|
* @return string|bool Language key of the error/incompatiblity occured otherwise false
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
function config_updated()
|
function config_updated()
|
||||||
{
|
{
|
||||||
global $db, $user, $config, $phpbb_root_path, $phpEx;
|
global $db, $user, $config, $phpbb_root_path, $phpEx;
|
||||||
|
@ -378,6 +397,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
* @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 false if no valid keywords were found and otherwise true
|
* @return false if no valid keywords were found and otherwise true
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function split_keywords(&$keywords, $terms)
|
function split_keywords(&$keywords, $terms)
|
||||||
{
|
{
|
||||||
|
@ -619,14 +640,14 @@ class phpbb_search_fulltext_sphinx
|
||||||
/**
|
/**
|
||||||
* Updates wordlist and wordmatch tables when a message is posted or changed
|
* Updates wordlist and wordmatch tables when a message is posted or changed
|
||||||
*
|
*
|
||||||
* @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 The id of the post which is modified/created
|
* @param int $post_id The id of the post which is modified/created
|
||||||
* @param string &$message New or updated post content
|
* @param string &$message New or updated post content
|
||||||
* @param string &$subject New or updated post subject
|
* @param string &$subject New or updated post subject
|
||||||
* @param int $poster_id Post author's user id
|
* @param int $poster_id Post author's user id
|
||||||
* @param int $forum_id The id of the forum in which the post is located
|
* @param int $forum_id The id of the forum in which the post is located
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
|
function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
|
||||||
{
|
{
|
||||||
|
@ -686,6 +707,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a post from the index after it was deleted
|
* Delete a post from the index after it was deleted
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index_remove($post_ids, $author_ids, $forum_ids)
|
function index_remove($post_ids, $author_ids, $forum_ids)
|
||||||
{
|
{
|
||||||
|
@ -700,6 +723,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy old cache entries
|
* Destroy old cache entries
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function tidy($create = false)
|
function tidy($create = false)
|
||||||
{
|
{
|
||||||
|
@ -724,6 +749,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create sphinx table
|
* Create sphinx table
|
||||||
|
*
|
||||||
|
* @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)
|
||||||
{
|
{
|
||||||
|
@ -758,6 +787,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drop sphinx table
|
* Drop sphinx table
|
||||||
|
*
|
||||||
|
* @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)
|
||||||
{
|
{
|
||||||
|
@ -785,6 +818,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the sphinx table was created
|
* Returns true if the sphinx table was created
|
||||||
|
*
|
||||||
|
* @return bool true if sphinx table was created
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index_created($allow_new_files = true)
|
function index_created($allow_new_files = true)
|
||||||
{
|
{
|
||||||
|
@ -817,6 +854,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kills the searchd process and makes sure there's no locks left over
|
* Kills the searchd process and makes sure there's no locks left over
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function shutdown_searchd()
|
function shutdown_searchd()
|
||||||
{
|
{
|
||||||
|
@ -846,6 +885,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
* files by calling shutdown_searchd.
|
* files by calling shutdown_searchd.
|
||||||
*
|
*
|
||||||
* @return boolean Whether searchd is running or not
|
* @return boolean Whether searchd is running or not
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function searchd_running()
|
function searchd_running()
|
||||||
{
|
{
|
||||||
|
@ -890,6 +931,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an associative array containing information about the indexes
|
* Returns an associative array containing information about the indexes
|
||||||
|
*
|
||||||
|
* @return string|bool Language string of error false otherwise
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function index_stats()
|
function index_stats()
|
||||||
{
|
{
|
||||||
|
@ -910,6 +955,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects stats that can be displayed on the index maintenance page
|
* Collects stats that can be displayed on the index maintenance page
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function get_stats()
|
function get_stats()
|
||||||
{
|
{
|
||||||
|
@ -957,6 +1004,10 @@ class phpbb_search_fulltext_sphinx
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of options for the ACP to display
|
* Returns a list of options for the ACP to display
|
||||||
|
*
|
||||||
|
* @return associative array containing template and config variables
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function acp()
|
function acp()
|
||||||
{
|
{
|
||||||
|
@ -1112,6 +1163,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
*
|
*
|
||||||
* @param string $path Path from which files shall be deleted
|
* @param string $path Path from which files shall be deleted
|
||||||
* @param string $pattern PCRE pattern that a file needs to match in order to be deleted
|
* @param string $pattern PCRE pattern that a file needs to match in order to be deleted
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function sphinx_unlink_by_pattern($path, $pattern)
|
function sphinx_unlink_by_pattern($path, $pattern)
|
||||||
{
|
{
|
||||||
|
@ -1132,6 +1185,8 @@ function sphinx_unlink_by_pattern($path, $pattern)
|
||||||
* @param string $file The filename from which the lines shall be read
|
* @param string $file The filename from which the lines shall be read
|
||||||
* @param int $amount The number of lines to be read from the end
|
* @param int $amount The number of lines to be read from the end
|
||||||
* @return string Last lines of the file
|
* @return string Last lines of the file
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function sphinx_read_last_lines($file, $amount)
|
function sphinx_read_last_lines($file, $amount)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue