From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:01:09 +0200 Subject: [ticket/11700] Move all recent code to namespaces PHPBB3-11700 --- phpBB/phpbb/search/base.php | 8 ++++--- phpBB/phpbb/search/fulltext_mysql.php | 16 +++++++------ phpBB/phpbb/search/fulltext_native.php | 22 +++++++++-------- phpBB/phpbb/search/fulltext_postgres.php | 16 +++++++------ phpBB/phpbb/search/fulltext_sphinx.php | 26 ++++++++++---------- phpBB/phpbb/search/sphinx/config.php | 34 ++++++++++++++------------- phpBB/phpbb/search/sphinx/config_comment.php | 8 ++++--- phpBB/phpbb/search/sphinx/config_section.php | 26 ++++++++++---------- phpBB/phpbb/search/sphinx/config_variable.php | 8 ++++--- 9 files changed, 91 insertions(+), 73 deletions(-) (limited to 'phpBB/phpbb/search') diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php index 914cef9167..2f6b225b99 100644 --- a/phpBB/phpbb/search/base.php +++ b/phpBB/phpbb/search/base.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\search; + /** * @ignore */ @@ -23,12 +25,12 @@ define('SEARCH_RESULT_IN_CACHE', 1); define('SEARCH_RESULT_INCOMPLETE', 2); /** -* phpbb_search_base +* \phpbb\search\base * optional base class for search plugins providing simple caching based on ACM * and functions to retrieve ignore_words and synonyms * @package search */ -class phpbb_search_base +class base { var $ignore_words = array(); var $match_synonym = array(); @@ -181,7 +183,7 @@ class phpbb_search_base $store_ids = array_slice($id_ary, 0, $length); - // create a new resultset if there is none for this search_key yet + // create a new \resultset if there is none for this search_key yet // or add the ids to the existing resultset if (!($store = $cache->get('_search_results_' . $search_key))) { diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index 7dc4da8ffe..8663af5969 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\search; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * Fulltext search for MySQL * @package search */ -class phpbb_search_fulltext_mysql extends phpbb_search_base +class fulltext_mysql extends \phpbb\search\base { /** * Associative array holding index stats @@ -36,19 +38,19 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Config object - * @var phpbb_config + * @var \phpbb\config\config */ protected $config; /** * Database connection - * @var phpbb_db_driver + * @var \phpbb\db\driver\driver */ protected $db; /** * User object - * @var phpbb_user + * @var \phpbb\user */ protected $user; @@ -74,7 +76,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base /** * Constructor - * Creates a new phpbb_search_fulltext_mysql, which is used as a search backend + * 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 */ @@ -701,7 +703,7 @@ 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 int $post_id contains the post id of the post to index @@ -712,7 +714,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base */ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { - // Split old and new post/subject to obtain array of words + // Split old and new \post/subject to obtain array of words $split_text = $this->split_message($message); $split_title = ($subject) ? $this->split_message($subject) : array(); diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 730c3a6c2d..006b88e07a 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\search; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * phpBB's own db driven fulltext search, version 2 * @package search */ -class phpbb_search_fulltext_native extends phpbb_search_base +class fulltext_native extends \phpbb\search\base { /** * Associative array holding index stats @@ -80,19 +82,19 @@ class phpbb_search_fulltext_native extends phpbb_search_base /** * Config object - * @var phpbb_config + * @var \phpbb\config\config */ protected $config; /** * Database connection - * @var phpbb_db_driver + * @var \phpbb\db\driver\driver */ protected $db; /** * User object - * @var phpbb_user + * @var \phpbb\user */ protected $user; @@ -1222,7 +1224,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base return; } - // Split old and new post/subject to obtain array of 'words' + // Split old and new \post/subject to obtain array of 'words' $split_text = $this->split_message($message); $split_title = $this->split_message($subject); @@ -1269,7 +1271,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base // We now have unique arrays of all words to be added and removed and // individual arrays of added and removed words for text and title. What - // we need to do now is add the new words (if they don't already exist) + // we need to do now is add the new \words (if they don't already exist) // and then add (or remove) matches between the words and this post if (sizeof($unique_add_words)) { @@ -1306,7 +1308,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base $this->db->sql_transaction('begin'); } - // now update the search match table, remove links to removed words and add links to new words + // now update the search match table, remove links to removed words and add links to new \words foreach ($words['del'] as $word_in => $word_ary) { $title_match = ($word_in == 'title') ? 1 : 0; @@ -1466,7 +1468,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base WHERE ' . $this->db->sql_in_set('word_id', $sql_in); $this->db->sql_query($sql); - // by setting search_last_gc to the new time here we make sure that if a user reloads because the + // by setting search_last_gc to the new \time here we make sure that if a user reloads because the // following query takes too long, he won't run into it again set_config('search_last_gc', time(), true); @@ -1556,7 +1558,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base * @param string $encoding Text encoding * @return string Cleaned up text, only alphanumeric chars are left * - * @todo normalizer::cleanup being able to be used? + * @todo \normalizer::cleanup being able to be used? */ protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8') { @@ -1588,7 +1590,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base * If we use it more widely, an instance of that class should be held in a * a global variable instead */ - utf_normalizer::nfc($text); + \utf_normalizer::nfc($text); /** * The first thing we do is: diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 6b4b310f2e..ba9215fcfd 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\search; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * Fulltext search for PostgreSQL * @package search */ -class phpbb_search_fulltext_postgres extends phpbb_search_base +class fulltext_postgres extends \phpbb\search\base { /** * Associative array holding index stats @@ -61,19 +63,19 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base /** * Config object - * @var phpbb_config + * @var \phpbb\config\config */ protected $config; /** * Database connection - * @var phpbb_db_driver + * @var \phpbb\db\driver\driver */ protected $db; /** * User object - * @var phpbb_user + * @var \phpbb\user */ protected $user; @@ -99,7 +101,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base /** * Constructor - * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend + * 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 */ @@ -731,7 +733,7 @@ class phpbb_search_fulltext_postgres 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 int $post_id contains the post id of the post to index @@ -742,7 +744,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base */ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { - // Split old and new post/subject to obtain array of words + // Split old and new \post/subject to obtain array of words $split_text = $this->split_message($message); $split_title = ($subject) ? $this->split_message($subject) : array(); diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 4f3f852664..81cb31e6e2 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\search; + /** */ if (!defined('IN_PHPBB')) @@ -26,7 +28,7 @@ define('SPHINX_CONNECT_WAIT_TIME', 300); * Fulltext search based on the sphinx search deamon * @package search */ -class phpbb_search_fulltext_sphinx +class fulltext_sphinx { /** * Associative array holding index stats @@ -73,25 +75,25 @@ class phpbb_search_fulltext_sphinx /** * Auth object - * @var phpbb_auth + * @var \phpbb\auth\auth */ protected $auth; /** * Config object - * @var phpbb_config + * @var \phpbb\config\config */ protected $config; /** * Database connection - * @var phpbb_db_driver + * @var \phpbb\db\driver\driver */ protected $db; /** * Database Tools object - * @var phpbb_db_tools + * @var \phpbb\db\tools */ protected $db_tools; @@ -103,7 +105,7 @@ class phpbb_search_fulltext_sphinx /** * User object - * @var phpbb_user + * @var \phpbb\user */ protected $user; @@ -122,7 +124,7 @@ class phpbb_search_fulltext_sphinx /** * Constructor - * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend + * 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 */ @@ -135,8 +137,8 @@ class phpbb_search_fulltext_sphinx $this->db = $db; $this->auth = $auth; - // Initialize phpbb_db_tools object - $this->db_tools = new phpbb_db_tools($this->db); + // Initialize \phpbb\db\tools object + $this->db_tools = new \phpbb\db\tools($this->db); if(!$this->config['fulltext_sphinx_id']) { @@ -151,7 +153,7 @@ class phpbb_search_fulltext_sphinx } // Initialize sphinx client - $this->sphinx = new SphinxClient(); + $this->sphinx = new \SphinxClient(); $this->sphinx->SetServer(($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost'), ($this->config['fulltext_sphinx_port'] ? (int) $this->config['fulltext_sphinx_port'] : 9312)); @@ -250,7 +252,7 @@ class phpbb_search_fulltext_sphinx /* Now that we're sure everything was entered correctly, generate a config for the index. We use a config value fulltext_sphinx_id for this, as it should be unique. */ - $config_object = new phpbb_search_sphinx_config($this->config_file_data); + $config_object = new \phpbb\search\sphinx\config($this->config_file_data); $config_data = array( 'source source_phpbb_' . $this->id . '_main' => array( array('type', $this->dbtype . ' # mysql or pgsql'), @@ -420,7 +422,7 @@ class phpbb_search_fulltext_sphinx $this->sphinx->SetMatchMode(SPH_MATCH_ANY); } - // Keep quotes and new lines + // Keep quotes and new \lines $keywords = str_replace(array('"', "\n"), array('"', ' '), trim($keywords)); if (strlen($keywords) > 0) diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php index f1864f0c8c..2468022428 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]; } @@ -61,16 +63,16 @@ class phpbb_search_sphinx_config } /** - * Appends a new empty section to the end of the 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 + * @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) { - $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 @@ -141,9 +143,9 @@ class phpbb_search_sphinx_config $section_name .= $line[$j]; } - // And then we create the new section object + // 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,7 +160,7 @@ 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; } @@ -174,7 +176,7 @@ 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; } } @@ -240,10 +242,10 @@ class phpbb_search_sphinx_config } // If a name and an equal sign were found then we have append a - // new variable object to the section + // 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; } @@ -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..66000e4031 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,15 +18,15 @@ 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; /** - * Create a new comment + * Create a new \comment * * @param string $exact_string The content of the comment including newlines, leading whitespace, etc. * diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php index 79c9c8563d..3a5631ca21 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; @@ -27,7 +29,7 @@ class phpbb_search_sphinx_config_section private $variables = array(); /** - * Construct a new section + * Construct a new \section * * @param string $name Name of the section * @param string $comment Comment that should be appended after the name in the @@ -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--; @@ -120,17 +122,17 @@ class phpbb_search_sphinx_config_section } /** - * Create a new variable object and append it to the variable list of this section + * Create a new \variable object and append it to the variable list of this 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 + * @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) { - $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..afe4190068 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,17 +18,17 @@ 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; private $comment; /** - * Constructs a new variable object + * Constructs a new \variable object * * @param string $name Name of the variable * @param string $value Value of the variable -- cgit v1.2.1 From 390dc86344c23b658085bae4a719399e5eb579f0 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 05:00:18 +0200 Subject: [ticket/11700] And some last comments with backslashes PHPBB3-11700 --- phpBB/phpbb/search/base.php | 2 +- phpBB/phpbb/search/fulltext_native.php | 6 +++--- phpBB/phpbb/search/sphinx/config.php | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'phpBB/phpbb/search') diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php index 2f6b225b99..f2f982c31b 100644 --- a/phpBB/phpbb/search/base.php +++ b/phpBB/phpbb/search/base.php @@ -183,7 +183,7 @@ class base $store_ids = array_slice($id_ary, 0, $length); - // create a new \resultset if there is none for this search_key yet + // create a new resultset if there is none for this search_key yet // or add the ids to the existing resultset if (!($store = $cache->get('_search_results_' . $search_key))) { diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 006b88e07a..50cf588a46 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -1271,7 +1271,7 @@ class fulltext_native extends \phpbb\search\base // We now have unique arrays of all words to be added and removed and // individual arrays of added and removed words for text and title. What - // we need to do now is add the new \words (if they don't already exist) + // we need to do now is add the new words (if they don't already exist) // and then add (or remove) matches between the words and this post if (sizeof($unique_add_words)) { @@ -1308,7 +1308,7 @@ class fulltext_native extends \phpbb\search\base $this->db->sql_transaction('begin'); } - // now update the search match table, remove links to removed words and add links to new \words + // now update the search match table, remove links to removed words and add links to new words foreach ($words['del'] as $word_in => $word_ary) { $title_match = ($word_in == 'title') ? 1 : 0; @@ -1468,7 +1468,7 @@ class fulltext_native extends \phpbb\search\base WHERE ' . $this->db->sql_in_set('word_id', $sql_in); $this->db->sql_query($sql); - // by setting search_last_gc to the new \time here we make sure that if a user reloads because the + // by setting search_last_gc to the new time here we make sure that if a user reloads because the // following query takes too long, he won't run into it again set_config('search_last_gc', time(), true); diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php index 2468022428..8462298e01 100644 --- a/phpBB/phpbb/search/sphinx/config.php +++ b/phpBB/phpbb/search/sphinx/config.php @@ -65,7 +65,7 @@ class config /** * Appends a new \empty section to the end of the 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 * * @access public @@ -143,7 +143,7 @@ class config $section_name .= $line[$j]; } - // And then we create the new \section object + // 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); } @@ -163,7 +163,7 @@ class config $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) @@ -182,7 +182,7 @@ class config } } - // 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) { @@ -241,8 +241,8 @@ class config } } - // If a name and an equal sign were found then we have append a - // new \variable object to the section + // 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)); @@ -250,7 +250,7 @@ class config } /* 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) { -- cgit v1.2.1 From d905358e2be11cc3fe040036b1138e54be7f30dc Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 05:20:27 +0200 Subject: [ticket/11700] Fix leftover backslashes in comments PHPBB3-11700 --- phpBB/phpbb/search/fulltext_mysql.php | 6 +++--- phpBB/phpbb/search/fulltext_postgres.php | 2 +- phpBB/phpbb/search/sphinx/config.php | 2 +- phpBB/phpbb/search/sphinx/config_section.php | 6 +++--- phpBB/phpbb/search/sphinx/config_variable.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'phpBB/phpbb/search') diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index a4812c139a..2508ab6d9a 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -41,13 +41,13 @@ class fulltext_mysql extends \phpbb\search\base * @var \phpbb\config\config */ protected $config; - + /** * Database connection * @var \phpbb\db\driver\driver */ protected $db; - + /** * User object * @var \phpbb\user @@ -703,7 +703,7 @@ class 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 int $post_id contains the post id of the post to index diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index ba9215fcfd..383645920a 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -733,7 +733,7 @@ class fulltext_postgres 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 int $post_id contains the post id of the post to index diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php index 8462298e01..262d6008cc 100644 --- a/phpBB/phpbb/search/sphinx/config.php +++ b/phpBB/phpbb/search/sphinx/config.php @@ -63,7 +63,7 @@ class config } /** - * Appends a new \empty section to the end of the 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 diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php index 3a5631ca21..7e6939576b 100644 --- a/phpBB/phpbb/search/sphinx/config_section.php +++ b/phpBB/phpbb/search/sphinx/config_section.php @@ -122,10 +122,10 @@ class config_section } /** - * Create a new \variable object and append it to the variable list of this section + * Create a new variable object and append it to the variable list of this section * - * @param string $name The name for the new \variable - * @param string $value The value for the new \variable + * @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 diff --git a/phpBB/phpbb/search/sphinx/config_variable.php b/phpBB/phpbb/search/sphinx/config_variable.php index afe4190068..c8f40bfb5f 100644 --- a/phpBB/phpbb/search/sphinx/config_variable.php +++ b/phpBB/phpbb/search/sphinx/config_variable.php @@ -28,7 +28,7 @@ class config_variable private $comment; /** - * Constructs a new \variable object + * Constructs a new variable object * * @param string $name Name of the variable * @param string $value Value of the variable -- cgit v1.2.1 From 06e7c842357fd26104efba6b7a0465d7c05c4493 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 19 Sep 2013 15:27:03 +0200 Subject: [ticket/11700] Fix some more incorrectly changed comments PHPBB3-11700 --- phpBB/phpbb/search/fulltext_mysql.php | 2 +- phpBB/phpbb/search/fulltext_native.php | 2 +- phpBB/phpbb/search/fulltext_postgres.php | 2 +- phpBB/phpbb/search/fulltext_sphinx.php | 2 +- phpBB/phpbb/search/sphinx/config_comment.php | 2 +- phpBB/phpbb/search/sphinx/config_section.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb/search') diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index 2508ab6d9a..50d2d2577f 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -714,7 +714,7 @@ class fulltext_mysql extends \phpbb\search\base */ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { - // Split old and new \post/subject to obtain array of words + // Split old and new post/subject to obtain array of words $split_text = $this->split_message($message); $split_title = ($subject) ? $this->split_message($subject) : array(); diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 50cf588a46..33326f2882 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -1224,7 +1224,7 @@ class fulltext_native extends \phpbb\search\base return; } - // Split old and new \post/subject to obtain array of 'words' + // Split old and new post/subject to obtain array of 'words' $split_text = $this->split_message($message); $split_title = $this->split_message($subject); diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 383645920a..756034103e 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -744,7 +744,7 @@ class fulltext_postgres extends \phpbb\search\base */ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { - // Split old and new \post/subject to obtain array of words + // Split old and new post/subject to obtain array of words $split_text = $this->split_message($message); $split_title = ($subject) ? $this->split_message($subject) : array(); diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 81cb31e6e2..cb76d58f49 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -422,7 +422,7 @@ class fulltext_sphinx $this->sphinx->SetMatchMode(SPH_MATCH_ANY); } - // Keep quotes and new \lines + // Keep quotes and new lines $keywords = str_replace(array('"', "\n"), array('"', ' '), trim($keywords)); if (strlen($keywords) > 0) diff --git a/phpBB/phpbb/search/sphinx/config_comment.php b/phpBB/phpbb/search/sphinx/config_comment.php index 66000e4031..77a943377d 100644 --- a/phpBB/phpbb/search/sphinx/config_comment.php +++ b/phpBB/phpbb/search/sphinx/config_comment.php @@ -26,7 +26,7 @@ class config_comment 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. * diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php index 7e6939576b..730abf011e 100644 --- a/phpBB/phpbb/search/sphinx/config_section.php +++ b/phpBB/phpbb/search/sphinx/config_section.php @@ -29,7 +29,7 @@ class config_section private $variables = array(); /** - * Construct a new \section + * Construct a new section * * @param string $name Name of the section * @param string $comment Comment that should be appended after the name in the -- cgit v1.2.1