mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/13162] Use db tools for truncating
PHPBB3-13162
This commit is contained in:
@@ -68,9 +68,10 @@ switch ($mode)
|
||||
|
||||
if (!$start)
|
||||
{
|
||||
$db->sql_query('TRUNCATE TABLE ' . POSTS_TABLE);
|
||||
$db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE);
|
||||
// $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch');
|
||||
$db_tools = $phpbb_container->get('dbal.tools');
|
||||
|
||||
$db_tools->sql_truncate_table(POSTS_TABLE);
|
||||
$db_tools->sql_truncate_table(TOPICS_TABLE);
|
||||
}
|
||||
|
||||
$db->sql_query('LOCK TABLES ' . POSTS_TABLE . ' WRITE, ' . TOPICS_TABLE . ' WRITE');
|
||||
|
@@ -105,7 +105,10 @@ function add_bots($bots)
|
||||
$result = $db->sql_query($sql);
|
||||
$group_id = (int) $db->sql_fetchfield('group_id', false, $result);
|
||||
$db->sql_freeresult($result);
|
||||
$db->sql_query('TRUNCATE TABLE ' . BOTS_TABLE);
|
||||
|
||||
// Truncate bots table
|
||||
$db_tools = $phpbb_container->get('dbal.tools');
|
||||
$db_tools->sql_truncate_table(BOTS_TABLE);
|
||||
|
||||
if (!$group_id)
|
||||
{
|
||||
@@ -118,9 +121,6 @@ function add_bots($bots)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
foreach ($bots as $bot_name => $bot_ary)
|
||||
{
|
||||
$user_row = array(
|
||||
|
Reference in New Issue
Block a user