[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:
Dhruv 2012-07-11 17:32:31 +05:30
parent b8103c5c31
commit 78e7f2a529
4 changed files with 50 additions and 11 deletions

View file

@ -23,13 +23,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_sphinx_config
{
var $loaded = false;
var $sections = array();
private $sections = array();
/**
* Constructor which optionally loads data from a variable
*
* @param string $config_data Variable containing the sphinx configuration data
*
* @access public
*/
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
* @return phpbb_search_sphinx_config_section The section object or null if none was found
*
* @access public
*/
function get_section_by_name($name)
{
@ -62,6 +65,8 @@ class phpbb_search_sphinx_config
*
* @param string $name The name for the new section
* @return phpbb_search_sphinx_config_section The newly created section object
*
* @access public
*/
function add_section($name)
{
@ -73,6 +78,8 @@ class phpbb_search_sphinx_config
* Reads the config file data
*
* @param string $config_data The config file data
*
* @access private
*/
function read($config_data)
{
@ -264,7 +271,9 @@ class phpbb_search_sphinx_config
/**
* 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()
{

View file

@ -21,12 +21,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_sphinx_config_comment
{
var $exact_string;
private $exact_string;
/**
* Create a new comment
*
* @param string $exact_string The content of the comment including newlines, leading whitespace, etc.
*
* @access public
*/
function __construct($exact_string)
{
@ -37,6 +39,8 @@ class phpbb_search_sphinx_config_comment
* Simply returns the comment as it was created
*
* @return string The exact string that was specified in the constructor
*
* @access public
*/
function to_string()
{

View file

@ -21,10 +21,10 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_sphinx_config_section
{
var $name;
var $comment;
var $end_comment;
var $variables = array();
private $name;
private $comment;
private $end_comment;
private $variables = array();
/**
* Construct a new section
@ -32,6 +32,8 @@ class phpbb_search_sphinx_config_section
* @param string $name Name of the section
* @param string $comment Comment that should be appended after the name in the
* textual format.
*
* @access public
*/
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
*
* @param phpbb_search_sphinx_config_variable $variable The variable object
*
* @access public
*/
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
*
* @param string $end_comment
*
* @access public
*/
function set_end_comment($end_comment)
{
@ -62,6 +70,8 @@ class phpbb_search_sphinx_config_section
* Getter for the name of this section
*
* @return string Section's name
*
* @access public
*/
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
* @return phpbb_search_sphinx_config_section The first variable object from this section with the
* given name or null if none was found
*
* @access public
*/
function get_variable_by_name($name)
{
@ -91,6 +103,8 @@ class phpbb_search_sphinx_config_section
* Deletes all variables with the given name
*
* @param string $name The name of the variable objects that are supposed to be removed
*
* @access public
*/
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 $value The value for the new variable
* @return phpbb_search_sphinx_config_variable Variable object that was created
*
* @access public
*/
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
*
* @return string Config data in textual form, parsable for sphinx
*
* @access public
*/
function to_string()
{

View file

@ -21,9 +21,9 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_sphinx_config_variable
{
var $name;
var $value;
var $comment;
private $name;
private $value;
private $comment;
/**
* Constructs a new variable object
@ -32,6 +32,8 @@ class phpbb_search_sphinx_config_variable
* @param string $value Value of the variable
* @param string $comment Optional comment after the variable in the
* config file
*
* @access public
*/
function __construct($name, $value, $comment)
{
@ -44,6 +46,8 @@ class phpbb_search_sphinx_config_variable
* Getter for the variable's name
*
* @return string The variable object's name
*
* @access public
*/
function get_name()
{
@ -54,6 +58,8 @@ class phpbb_search_sphinx_config_variable
* Allows changing the variable's value
*
* @param string $value New value for this variable
*
* @access public
*/
function set_value($value)
{
@ -64,6 +70,8 @@ class phpbb_search_sphinx_config_variable
* Turns this object into a string readable by sphinx
*
* @return string Config data in textual form
*
* @access public
*/
function to_string()
{