Compare commits

...

16 commits

Author SHA1 Message Date
v12mike
61ae43fa62
Merge 17c64bada3 into bc1e1732cf 2025-04-27 14:16:36 +00:00
Marc Alexander
bc1e1732cf
Merge pull request #6809 from marc1706/ticket/17503
[ticket/17503] Update composer dependencies to latest versions
2025-04-26 08:43:46 +02:00
Marc Alexander
ee889ac98b Merge branch '3.3.x' 2025-04-26 06:34:28 +00:00
Marc Alexander
b7d2243f6c
Merge pull request #6808 from rxu/ticket/16941-master
[ticket/16941] Add sphinx tests - master
2025-04-26 08:34:14 +02:00
Marc Alexander
59e8875fa8
Merge pull request #6807 from rxu/ticket/16941
[ticket/16941] Add sphinx tests to 3.3.x
2025-04-26 08:34:09 +02:00
rxu
f11512b580
Merge branch 'ticket/16941' into ticket/16941-master 2025-04-25 22:12:50 +07:00
rxu
1ae9a49811
[ticket/16941] Remove ending slash from binlog_path
PHPBB3-14401
2025-04-25 21:28:36 +07:00
Marc Alexander
5ef1a40083
[ticket/17503] Update lock to latest composer format
PHPBB-17503
2025-04-24 21:45:53 +02:00
Marc Alexander
d95437682e
[ticket/17503] Update composer to its latest version
PHPBB-17503
2025-04-24 21:45:17 +02:00
Marc Alexander
99ffd9205f
[ticket/17503] Update composer dependencies to their latest versions
PHPBB-17503
2025-04-24 21:44:43 +02:00
rxu
80a08d9c54
[ticket/16941] Add sphinx tests to 3.3.x
Also adjust Sphinx keywords splitting to be consistent with other search
backends when it comes to handling hyphen (like ignoring hyphen when it hasn't
NOT meaning and ignoring hyphen wrapped with "plus" signs)

PHPBB3-16941
2025-04-24 23:17:26 +07:00
v12mike
17c64bada3
Update viewonline.php
remove html from php file
2021-10-22 13:48:24 +13:00
v12mike
4761fef7a8 [ticket/16558] Improve viewonline page
Fix overload of variables

PHPBB3-16558
2020-07-29 23:49:10 -04:00
v12mike
8d0c38383c [ticket/16558] Improve viewonline page
Fix memory leak

PHPBB3-16558
2020-07-29 00:05:36 -04:00
v12mike
9f682ea220 [ticket/16558] Improve viewonline page
Remove unsupport PHP syntax

PHPBB3-16558
2020-07-28 23:54:57 -04:00
v12mike
aa3472ce76 [ticket/16558] Improve viewonline page
Pages that are not handled by viewonline now shown as "Unrecognised Page"
Admins see the URI of session table page

PHPBB3-16558
2020-07-28 19:10:07 -04:00
10 changed files with 441 additions and 257 deletions

View file

@ -135,7 +135,7 @@ searchd
read_timeout = 5
max_children = 30
pid_file = $SPHINX_DATA_DIR/searchd.pid
binlog_path = $SPHINX_DATA_DIR/
binlog_path = $SPHINX_DATA_DIR
}
" > $SPHINX_CONF

Binary file not shown.

579
phpBB/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -865,6 +865,7 @@ $lang = array_merge($lang, array(
'UNREAD_MESSAGES' => 'Unread messages',
'UNREAD_POST' => 'Unread post',
'UNREAD_POSTS' => 'Unread posts',
'UNRECOGNISED_PAGE' => 'Unrecognised page',
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
'UNWATCH_FORUM_DETAILED' => 'Are you sure you wish to unsubscribe from the forum “%s”?',
'UNWATCH_TOPIC_CONFIRM' => 'Are you sure you wish to unsubscribe from this topic?',

View file

@ -952,7 +952,7 @@ class fulltext_sphinx implements search_backend_interface
array('read_timeout', '5'),
array('max_children', '30'),
array('pid_file', $this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),
array('binlog_path', $this->config['fulltext_sphinx_data_path']),
array('binlog_path', rtrim($this->config['fulltext_sphinx_data_path'], '/\\')), // Trim trailing slash
),
);

View file

@ -268,6 +268,57 @@ foreach ($session_data_rowset as $row)
case 'viewtopic':
$forum_id = $row['session_forum_id'];
if (!$forum_id)
{
$array_match_index = 5;
// find the forum_id from the page URI
$matches = array();
$pattern = '#(viewtopic|posting)\.' . $phpEx . '((\?|&)\w+=\w+)*(\?|&)';
preg_match($pattern . 'f=(\d+)#', $row['session_page'], $matches);
if ($matches[$array_match_index])
{
$forum_id = (int) $matches[$array_match_index];
}
else
{
preg_match($pattern . 't=(\d+)#', $row['session_page'], $matches);
if ($matches[$array_match_index])
{
$topic_id = $matches[$array_match_index];
$sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $topic_id";
$result1 = $db->sql_query($sql);
$forum_id = (int) $db->sql_fetchfield('forum_id');
$db->sql_freeresult($result1);
}
else
{
preg_match($pattern . 'p=(\d+)#', $row['session_page'], $matches);
if ($matches[$array_match_index])
{
$post_id = $matches[$array_match_index];
$topic_forum = array();
$sql = 'SELECT t.forum_id
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE p.post_id = ' . $post_id . '
AND t.topic_id = p.topic_id';
$result1 = $db->sql_query($sql);
$forum_id = (int) $db->sql_fetchfield('forum_id');
$db->sql_freeresult($result1);
}
else
{
$forum_id = 0;
}
}
}
}
if ($forum_id && $auth->acl_get('f_list', $forum_id))
{
$location = '';
@ -309,7 +360,7 @@ foreach ($session_data_rowset as $row)
}
else
{
$location = $user->lang['INDEX'];
$location = $user->lang['UNRECOGNISED_PAGE'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
}
break;
@ -382,17 +433,23 @@ foreach ($session_data_rowset as $row)
break;
default:
$location = $user->lang['INDEX'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
if ($row['session_page'] === 'app.' . $phpEx . '/help/faq' ||
$row['session_page'] === 'app.' . $phpEx . '/help/bbcode')
{
$location = $user->lang['VIEWING_FAQ'];
$location_url = $controller_helper->route('phpbb_help_faq_controller');
}
else
{
$location = $user->lang['UNRECOGNISED_PAGE'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
}
break;
}
if ($auth->acl_get('a_'))
{
$location .= nl2br("\n" . substr($row['session_page'], 0, 99));
}
/**
* Overwrite the location's name and URL, which are displayed in the list
@ -410,7 +467,7 @@ foreach ($session_data_rowset as $row)
extract($phpbb_dispatcher->trigger_event('core.viewonline_overwrite_location', compact($vars)));
$template_row = array(
'USERNAME' => $row['username'],
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => $row['user_colour'],
'USERNAME_FULL' => $username_full,
'LASTUPDATE' => $user->format_date($row['session_time']),

View file

@ -263,7 +263,12 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Ensure search index has been actually created
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $search_type) . ' td')->eq(1)->text();
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $search_type) . ' td')->reduce(
function ($node, $i) {
// Find the value of total posts indexed
return (strpos($node->text(), $this->lang('FULLTEXT_MYSQL_TOTAL_POSTS')) !== false || strpos($node->text(), $this->lang('TOTAL_WORDS')) !== false);
})
->nextAll()->eq(0)->text();
$this->assertTrue($posts_indexed > 0);
}
@ -300,7 +305,12 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Ensure search index has been actually removed
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $this->search_backend) . ' td')->eq(1)->text();
$posts_indexed = (int) $crawler->filter('#acp_search_index_' . str_replace('\\', '-', $this->search_backend) . ' td')->reduce(
function ($node, $i) {
// Find the value of total posts indexed
return (strpos($node->text(), $this->lang('FULLTEXT_MYSQL_TOTAL_POSTS')) !== false || strpos($node->text(), $this->lang('TOTAL_WORDS')) !== false);
})
->nextAll()->eq(0)->text();
$this->assertEquals(0, $posts_indexed);
}
}

View file

@ -27,8 +27,10 @@ class phpbb_functional_search_sphinx_test extends phpbb_functional_search_base
if (!$backend || $this->search_backend == $backend)
{
$output = $retval = null;
// After creating phpBB search index, build Sphinx index
exec('sudo -S service sphinxsearch stop', $output, $retval); // Attemtp to stop sphinxsearch service in case it's running
exec('sudo -S service sphinxsearch stop', $output, $retval); // Attempt to stop sphinxsearch service in case it's running
exec('sudo -S indexer --all', $output, $retval); // Run sphinxsearch indexer
exec('sudo -S service sphinxsearch start', $output, $retval); // Attempt to start sphinxsearch service again
}

View file

@ -601,7 +601,16 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
// Assert new topic title is indexed as well
$this->add_lang('search');
self::request('GET', "search.php?keywords=bang&sid={$this->sid}");
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
// Sphinx search doesn't apply to unapproved or softdeleted posts
if (strpos($this->get_search_type(), 'fulltext_sphinx'))
{
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][2], 0), self::get_content());
}
else
{
$this->assertStringContainsString(sprintf($this->lang['FOUND_SEARCH_MATCHES'][1], 1), self::get_content());
}
}
public function test_move_topic_back()

View file

@ -895,6 +895,24 @@ class phpbb_functional_test_case extends phpbb_test_case
return $group_id;
}
/**
* Get current board's search type
*
* @return string Current search type setting
*/
protected function get_search_type()
{
$db = $this->get_db();
$sql = 'SELECT config_value as search_type
FROM ' . CONFIG_TABLE . "
WHERE config_name = '" . $db->sql_escape('search_type') . "'";
$result = $db->sql_query($sql);
$search_type = $db->sql_fetchfield('search_type');
$db->sql_freeresult($result);
return $search_type;
}
protected function remove_user_group($group_name, $usernames)
{
global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $user, $phpbb_root_path, $phpEx;