aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/search/sphinx
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/search/sphinx')
-rw-r--r--phpBB/phpbb/search/sphinx/config.php34
-rw-r--r--phpBB/phpbb/search/sphinx/config_comment.php6
-rw-r--r--phpBB/phpbb/search/sphinx/config_section.php18
-rw-r--r--phpBB/phpbb/search/sphinx/config_variable.php6
4 files changed, 36 insertions, 28 deletions
diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php
index f1864f0c8c..262d6008cc 100644
--- a/phpBB/phpbb/search/sphinx/config.php
+++ b/phpBB/phpbb/search/sphinx/config.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config
+* \phpbb\search\sphinx\config
* An object representing the sphinx configuration
* Can read it from file and write it back out after modification
* @package search
*/
-class phpbb_search_sphinx_config
+class config
{
private $sections = array();
@@ -44,7 +46,7 @@ class phpbb_search_sphinx_config
* Get a section object by its name
*
* @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
*/
@@ -53,7 +55,7 @@ class phpbb_search_sphinx_config
for ($i = 0, $size = sizeof($this->sections); $i < $size; $i++)
{
// Make sure this is really a section object and not a comment
- if (($this->sections[$i] instanceof phpbb_search_sphinx_config_section) && $this->sections[$i]->get_name() == $name)
+ if (($this->sections[$i] instanceof \phpbb\search\sphinx\config_section) && $this->sections[$i]->get_name() == $name)
{
return $this->sections[$i];
}
@@ -64,13 +66,13 @@ class phpbb_search_sphinx_config
* Appends a new empty section to the end of the config
*
* @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)
{
- $this->sections[] = new phpbb_search_sphinx_config_section($name, '');
+ $this->sections[] = new \phpbb\search\sphinx\config_section($name, '');
return $this->sections[sizeof($this->sections) - 1];
}
@@ -109,7 +111,7 @@ class phpbb_search_sphinx_config
// that way they're not deleted when reassembling the file from the sections
if (!$line || $line[0] == '#')
{
- $this->sections[] = new phpbb_search_sphinx_config_comment($config_file[$i]);
+ $this->sections[] = new \phpbb\search\sphinx\config_comment($config_file[$i]);
continue;
}
else
@@ -143,7 +145,7 @@ class phpbb_search_sphinx_config
// And then we create the new section object
$section_name = trim($section_name);
- $section = new phpbb_search_sphinx_config_section($section_name, $section_name_comment);
+ $section = new \phpbb\search\sphinx\config_section($section_name, $section_name_comment);
}
}
else
@@ -158,10 +160,10 @@ class phpbb_search_sphinx_config
// of this section so they're not deleted on reassembly
if (!$line || $line[0] == '#')
{
- $section->add_variable(new phpbb_search_sphinx_config_comment($config_file[$i]));
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i]));
continue;
}
-
+
// As long as we haven't yet actually found an opening bracket for this section
// we treat everything as comments so it's not deleted either
if (!$found_opening_bracket)
@@ -174,13 +176,13 @@ class phpbb_search_sphinx_config
}
else
{
- $section->add_variable(new phpbb_search_sphinx_config_comment($config_file[$i]));
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i]));
continue;
}
}
}
- // If we did not find a comment in this line or still add to the previous
+ // If we did not find a comment in this line or still add to the previous
// line's value ...
if ($line || $in_value)
{
@@ -239,16 +241,16 @@ class phpbb_search_sphinx_config
}
}
- // If a name and an equal sign were found then we have append a
+ // If a name and an equal sign were found then we have append a
// new variable object to the section
if ($name && $found_assignment)
{
- $section->add_variable(new phpbb_search_sphinx_config_variable(trim($name), trim($value), ($end_section) ? '' : $comment));
+ $section->add_variable(new \phpbb\search\sphinx\config_variable(trim($name), trim($value), ($end_section) ? '' : $comment));
continue;
}
/* If we found a closing curly bracket this section has been completed
- and we can append it to the section list and continue with looking for
+ and we can append it to the section list and continue with looking for
the next section */
if ($end_section)
{
@@ -262,7 +264,7 @@ class phpbb_search_sphinx_config
// If we did not find anything meaningful up to here, then just treat it
// as a comment
$comment = ($skip_first) ? "\t" . substr(ltrim($config_file[$i]), 1) : $config_file[$i];
- $section->add_variable(new phpbb_search_sphinx_config_comment($comment));
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($comment));
}
}
diff --git a/phpBB/phpbb/search/sphinx/config_comment.php b/phpBB/phpbb/search/sphinx/config_comment.php
index 7f695dbf0c..77a943377d 100644
--- a/phpBB/phpbb/search/sphinx/config_comment.php
+++ b/phpBB/phpbb/search/sphinx/config_comment.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,10 +18,10 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config_comment
+* \phpbb\search\sphinx\config_comment
* Represents a comment inside the sphinx configuration
*/
-class phpbb_search_sphinx_config_comment
+class config_comment
{
private $exact_string;
diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php
index 79c9c8563d..730abf011e 100644
--- a/phpBB/phpbb/search/sphinx/config_section.php
+++ b/phpBB/phpbb/search/sphinx/config_section.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,10 +18,10 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config_section
+* \phpbb\search\sphinx\config_section
* Represents a single section inside the sphinx configuration
*/
-class phpbb_search_sphinx_config_section
+class config_section
{
private $name;
private $comment;
@@ -45,7 +47,7 @@ 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
+ * @param \phpbb\search\sphinx\config_variable $variable The variable object
*
* @access public
*/
@@ -82,7 +84,7 @@ class phpbb_search_sphinx_config_section
* Get a variable object by its name
*
* @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
*
* @access public
@@ -92,7 +94,7 @@ class phpbb_search_sphinx_config_section
for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++)
{
// Make sure this is a variable object and not a comment
- if (($this->variables[$i] instanceof phpbb_search_sphinx_config_variable) && $this->variables[$i]->get_name() == $name)
+ if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name)
{
return $this->variables[$i];
}
@@ -111,7 +113,7 @@ class phpbb_search_sphinx_config_section
for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++)
{
// Make sure this is a variable object and not a comment
- if (($this->variables[$i] instanceof phpbb_search_sphinx_config_variable) && $this->variables[$i]->get_name() == $name)
+ if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name)
{
array_splice($this->variables, $i, 1);
$i--;
@@ -124,13 +126,13 @@ 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
+ * @return \phpbb\search\sphinx\config_variable Variable object that was created
*
* @access public
*/
function create_variable($name, $value)
{
- $this->variables[] = new phpbb_search_sphinx_config_variable($name, $value, '');
+ $this->variables[] = new \phpbb\search\sphinx\config_variable($name, $value, '');
return $this->variables[sizeof($this->variables) - 1];
}
diff --git a/phpBB/phpbb/search/sphinx/config_variable.php b/phpBB/phpbb/search/sphinx/config_variable.php
index 2c1d35a49c..c8f40bfb5f 100644
--- a/phpBB/phpbb/search/sphinx/config_variable.php
+++ b/phpBB/phpbb/search/sphinx/config_variable.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,10 +18,10 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config_variable
+* \phpbb\search\sphinx\config_variable
* Represents a single variable inside the sphinx configuration
*/
-class phpbb_search_sphinx_config_variable
+class config_variable
{
private $name;
private $value;