mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/sphinx-fulltext-search] improve sphinx helper classes
add access modifiers and docblocks to properties and methods of sphinx helper classes. PHPBB3-10946
This commit is contained in:
parent
b8103c5c31
commit
78e7f2a529
4 changed files with 50 additions and 11 deletions
|
@ -23,13 +23,14 @@ if (!defined('IN_PHPBB'))
|
||||||
*/
|
*/
|
||||||
class phpbb_search_sphinx_config
|
class phpbb_search_sphinx_config
|
||||||
{
|
{
|
||||||
var $loaded = false;
|
private $sections = array();
|
||||||
var $sections = array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor which optionally loads data from a variable
|
* Constructor which optionally loads data from a variable
|
||||||
*
|
*
|
||||||
* @param string $config_data Variable containing the sphinx configuration data
|
* @param string $config_data Variable containing the sphinx configuration data
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function __construct($config_data)
|
function __construct($config_data)
|
||||||
{
|
{
|
||||||
|
@ -44,6 +45,8 @@ class phpbb_search_sphinx_config
|
||||||
*
|
*
|
||||||
* @param string $name The name of the section that shall be returned
|
* @param string $name The name of the section that shall be returned
|
||||||
* @return phpbb_search_sphinx_config_section The section object or null if none was found
|
* @return phpbb_search_sphinx_config_section The section object or null if none was found
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function get_section_by_name($name)
|
function get_section_by_name($name)
|
||||||
{
|
{
|
||||||
|
@ -62,6 +65,8 @@ class phpbb_search_sphinx_config
|
||||||
*
|
*
|
||||||
* @param string $name The name for the new section
|
* @param string $name The name for the new section
|
||||||
* @return phpbb_search_sphinx_config_section The newly created section object
|
* @return phpbb_search_sphinx_config_section The newly created section object
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function add_section($name)
|
function add_section($name)
|
||||||
{
|
{
|
||||||
|
@ -73,6 +78,8 @@ class phpbb_search_sphinx_config
|
||||||
* Reads the config file data
|
* Reads the config file data
|
||||||
*
|
*
|
||||||
* @param string $config_data The config file data
|
* @param string $config_data The config file data
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function read($config_data)
|
function read($config_data)
|
||||||
{
|
{
|
||||||
|
@ -264,7 +271,9 @@ class phpbb_search_sphinx_config
|
||||||
/**
|
/**
|
||||||
* Returns the config data
|
* Returns the config data
|
||||||
*
|
*
|
||||||
* @return string $data The config data that is generated.
|
* @return string $data The config data that is generated
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function get_data()
|
function get_data()
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,12 +21,14 @@ if (!defined('IN_PHPBB'))
|
||||||
*/
|
*/
|
||||||
class phpbb_search_sphinx_config_comment
|
class phpbb_search_sphinx_config_comment
|
||||||
{
|
{
|
||||||
var $exact_string;
|
private $exact_string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new comment
|
* Create a new comment
|
||||||
*
|
*
|
||||||
* @param string $exact_string The content of the comment including newlines, leading whitespace, etc.
|
* @param string $exact_string The content of the comment including newlines, leading whitespace, etc.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function __construct($exact_string)
|
function __construct($exact_string)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +39,8 @@ class phpbb_search_sphinx_config_comment
|
||||||
* Simply returns the comment as it was created
|
* Simply returns the comment as it was created
|
||||||
*
|
*
|
||||||
* @return string The exact string that was specified in the constructor
|
* @return string The exact string that was specified in the constructor
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function to_string()
|
function to_string()
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,10 +21,10 @@ if (!defined('IN_PHPBB'))
|
||||||
*/
|
*/
|
||||||
class phpbb_search_sphinx_config_section
|
class phpbb_search_sphinx_config_section
|
||||||
{
|
{
|
||||||
var $name;
|
private $name;
|
||||||
var $comment;
|
private $comment;
|
||||||
var $end_comment;
|
private $end_comment;
|
||||||
var $variables = array();
|
private $variables = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new section
|
* Construct a new section
|
||||||
|
@ -32,6 +32,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* @param string $name Name of the section
|
* @param string $name Name of the section
|
||||||
* @param string $comment Comment that should be appended after the name in the
|
* @param string $comment Comment that should be appended after the name in the
|
||||||
* textual format.
|
* textual format.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function __construct($name, $comment)
|
function __construct($name, $comment)
|
||||||
{
|
{
|
||||||
|
@ -44,6 +46,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* Add a variable object to the list of variables in this section
|
* Add a variable object to the list of variables in this section
|
||||||
*
|
*
|
||||||
* @param phpbb_search_sphinx_config_variable $variable The variable object
|
* @param phpbb_search_sphinx_config_variable $variable The variable object
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function add_variable($variable)
|
function add_variable($variable)
|
||||||
{
|
{
|
||||||
|
@ -52,6 +56,10 @@ class phpbb_search_sphinx_config_section
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a comment after the closing bracket in the textual representation
|
* Adds a comment after the closing bracket in the textual representation
|
||||||
|
*
|
||||||
|
* @param string $end_comment
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function set_end_comment($end_comment)
|
function set_end_comment($end_comment)
|
||||||
{
|
{
|
||||||
|
@ -62,6 +70,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* Getter for the name of this section
|
* Getter for the name of this section
|
||||||
*
|
*
|
||||||
* @return string Section's name
|
* @return string Section's name
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function get_name()
|
function get_name()
|
||||||
{
|
{
|
||||||
|
@ -74,6 +84,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* @param string $name The name of the variable that shall be returned
|
* @param string $name The name of the variable that shall be returned
|
||||||
* @return phpbb_search_sphinx_config_section The first variable object from this section with the
|
* @return phpbb_search_sphinx_config_section The first variable object from this section with the
|
||||||
* given name or null if none was found
|
* given name or null if none was found
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function get_variable_by_name($name)
|
function get_variable_by_name($name)
|
||||||
{
|
{
|
||||||
|
@ -91,6 +103,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* Deletes all variables with the given name
|
* Deletes all variables with the given name
|
||||||
*
|
*
|
||||||
* @param string $name The name of the variable objects that are supposed to be removed
|
* @param string $name The name of the variable objects that are supposed to be removed
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function delete_variables_by_name($name)
|
function delete_variables_by_name($name)
|
||||||
{
|
{
|
||||||
|
@ -111,6 +125,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* @param string $name The name for the new variable
|
* @param string $name The name for the new variable
|
||||||
* @param string $value The value for the new variable
|
* @param string $value The value for the new variable
|
||||||
* @return phpbb_search_sphinx_config_variable Variable object that was created
|
* @return phpbb_search_sphinx_config_variable Variable object that was created
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function create_variable($name, $value)
|
function create_variable($name, $value)
|
||||||
{
|
{
|
||||||
|
@ -122,6 +138,8 @@ class phpbb_search_sphinx_config_section
|
||||||
* Turns this object into a string which can be written to a config file
|
* Turns this object into a string which can be written to a config file
|
||||||
*
|
*
|
||||||
* @return string Config data in textual form, parsable for sphinx
|
* @return string Config data in textual form, parsable for sphinx
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function to_string()
|
function to_string()
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,9 +21,9 @@ if (!defined('IN_PHPBB'))
|
||||||
*/
|
*/
|
||||||
class phpbb_search_sphinx_config_variable
|
class phpbb_search_sphinx_config_variable
|
||||||
{
|
{
|
||||||
var $name;
|
private $name;
|
||||||
var $value;
|
private $value;
|
||||||
var $comment;
|
private $comment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new variable object
|
* Constructs a new variable object
|
||||||
|
@ -32,6 +32,8 @@ class phpbb_search_sphinx_config_variable
|
||||||
* @param string $value Value of the variable
|
* @param string $value Value of the variable
|
||||||
* @param string $comment Optional comment after the variable in the
|
* @param string $comment Optional comment after the variable in the
|
||||||
* config file
|
* config file
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function __construct($name, $value, $comment)
|
function __construct($name, $value, $comment)
|
||||||
{
|
{
|
||||||
|
@ -44,6 +46,8 @@ class phpbb_search_sphinx_config_variable
|
||||||
* Getter for the variable's name
|
* Getter for the variable's name
|
||||||
*
|
*
|
||||||
* @return string The variable object's name
|
* @return string The variable object's name
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function get_name()
|
function get_name()
|
||||||
{
|
{
|
||||||
|
@ -54,6 +58,8 @@ class phpbb_search_sphinx_config_variable
|
||||||
* Allows changing the variable's value
|
* Allows changing the variable's value
|
||||||
*
|
*
|
||||||
* @param string $value New value for this variable
|
* @param string $value New value for this variable
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function set_value($value)
|
function set_value($value)
|
||||||
{
|
{
|
||||||
|
@ -64,6 +70,8 @@ class phpbb_search_sphinx_config_variable
|
||||||
* Turns this object into a string readable by sphinx
|
* Turns this object into a string readable by sphinx
|
||||||
*
|
*
|
||||||
* @return string Config data in textual form
|
* @return string Config data in textual form
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function to_string()
|
function to_string()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue