mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[feature/sphinx-fulltext-search] fixing comments
Use // for two liners in comments. PHPBB3-10946
This commit is contained in:
parent
9f2faaa8f1
commit
747af894a0
2 changed files with 18 additions and 18 deletions
|
@ -483,8 +483,8 @@ class phpbb_search_fulltext_sphinx
|
||||||
$this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES);
|
$this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES);
|
||||||
$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
|
$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
|
||||||
|
|
||||||
/* Could be connection to localhost:3312 failed (errno=111,
|
// Could be connection to localhost:3312 failed (errno=111,
|
||||||
msg=Connection refused) during rotate, retry if so */
|
// msg=Connection refused) during rotate, retry if so
|
||||||
$retries = SPHINX_CONNECT_RETRIES;
|
$retries = SPHINX_CONNECT_RETRIES;
|
||||||
while (!$result && (strpos($this->sphinx->_error, "errno=111,") !== false) && $retries--)
|
while (!$result && (strpos($this->sphinx->_error, "errno=111,") !== false) && $retries--)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,8 +91,8 @@ class phpbb_search_sphinx_config
|
||||||
|
|
||||||
foreach ($config_data as $i => $line)
|
foreach ($config_data as $i => $line)
|
||||||
{
|
{
|
||||||
/* If the value of a variable continues to the next line because the line
|
// If the value of a variable continues to the next line because the line
|
||||||
break was escaped then we don't trim leading space but treat it as a part of the value */
|
// break was escaped then we don't trim leading space but treat it as a part of the value
|
||||||
if ($in_value)
|
if ($in_value)
|
||||||
{
|
{
|
||||||
$line = rtrim($line);
|
$line = rtrim($line);
|
||||||
|
@ -105,8 +105,8 @@ class phpbb_search_sphinx_config
|
||||||
// If we're not inside a section look for one
|
// If we're not inside a section look for one
|
||||||
if (!$section)
|
if (!$section)
|
||||||
{
|
{
|
||||||
/* Add empty lines and comments as comment objects to the section list
|
// Add empty lines and comments as comment objects to the section list
|
||||||
that way they're not deleted when reassembling the file from the sections*/
|
// that way they're not deleted when reassembling the file from the sections
|
||||||
if (!$line || $line[0] == '#')
|
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]);
|
||||||
|
@ -114,8 +114,8 @@ class phpbb_search_sphinx_config
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Otherwise we scan the line reading the section name until we find
|
// Otherwise we scan the line reading the section name until we find
|
||||||
an opening curly bracket or a comment */
|
// an opening curly bracket or a comment
|
||||||
$section_name = '';
|
$section_name = '';
|
||||||
$section_name_comment = '';
|
$section_name_comment = '';
|
||||||
$found_opening_bracket = false;
|
$found_opening_bracket = false;
|
||||||
|
@ -154,16 +154,16 @@ class phpbb_search_sphinx_config
|
||||||
// If we're not in a value continuing over the line feed
|
// If we're not in a value continuing over the line feed
|
||||||
if (!$in_value)
|
if (!$in_value)
|
||||||
{
|
{
|
||||||
/* Then add empty lines and comments as comment objects to the variable list
|
// Then add empty lines and comments as comment objects to the variable list
|
||||||
of this section so they're not deleted on reassembly */
|
// of this section so they're not deleted on reassembly
|
||||||
if (!$line || $line[0] == '#')
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* As long as we haven't yet actually found an opening bracket for this section
|
// 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 */
|
// we treat everything as comments so it's not deleted either
|
||||||
if (!$found_opening_bracket)
|
if (!$found_opening_bracket)
|
||||||
{
|
{
|
||||||
if ($line[0] == '{')
|
if ($line[0] == '{')
|
||||||
|
@ -180,8 +180,8 @@ class phpbb_search_sphinx_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 ... */
|
// line's value ...
|
||||||
if ($line || $in_value)
|
if ($line || $in_value)
|
||||||
{
|
{
|
||||||
if (!$in_value)
|
if (!$in_value)
|
||||||
|
@ -239,8 +239,8 @@ 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 */
|
// new variable object to the section
|
||||||
if ($name && $found_assignment)
|
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));
|
||||||
|
@ -259,8 +259,8 @@ class phpbb_search_sphinx_config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we did not find anything meaningful up to here, then just treat it
|
// If we did not find anything meaningful up to here, then just treat it
|
||||||
as a comment */
|
// as a comment
|
||||||
$comment = ($skip_first) ? "\t" . substr(ltrim($config_file[$i]), 1) : $config_file[$i];
|
$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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue