aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-03-29 08:56:10 -0700
committerNils Adermann <naderman@naderman.de>2013-03-29 08:56:10 -0700
commitfe93ceb20ec23752cdfc7b5c21dfb162ed288fae (patch)
treebfe516428772853033370a739aa151a5becee649 /phpBB
parent1b71779432d6325d6f7da0671a07eaf7d400bfbc (diff)
parentb156b22f35eab64a9780167bfe8d515f2e2a8480 (diff)
downloadforums-fe93ceb20ec23752cdfc7b5c21dfb162ed288fae.tar
forums-fe93ceb20ec23752cdfc7b5c21dfb162ed288fae.tar.gz
forums-fe93ceb20ec23752cdfc7b5c21dfb162ed288fae.tar.bz2
forums-fe93ceb20ec23752cdfc7b5c21dfb162ed288fae.tar.xz
forums-fe93ceb20ec23752cdfc7b5c21dfb162ed288fae.zip
Merge pull request #1306 from bantu/ticket/11403
[ticket/11403] phpbb_notification_manager: Use SQL multi insert in batch...
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/notification/manager.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php
index 4e26234390..9eceeb753a 100644
--- a/phpBB/includes/notification/manager.php
+++ b/phpBB/includes/notification/manager.php
@@ -390,7 +390,6 @@ class phpbb_notification_manager
$user_ids = array();
$notification_objects = $notification_methods = array();
- $new_rows = array();
// Never send notifications to the anonymous user!
unset($notify_users[ANONYMOUS]);
@@ -420,6 +419,8 @@ class phpbb_notification_manager
$pre_create_data = $notification->pre_create_insert_array($data, $notify_users);
unset($notification);
+ $insert_buffer = new phpbb_db_sql_insert_buffer($this->db, $this->notifications_table);
+
// Go through each user so we can insert a row in the DB and then notify them by their desired means
foreach ($notify_users as $user => $methods)
{
@@ -427,8 +428,8 @@ class phpbb_notification_manager
$notification->user_id = (int) $user;
- // Store the creation array in our new rows that will be inserted later
- $new_rows[] = $notification->create_insert_array($data, $pre_create_data);
+ // Insert notification row using buffer.
+ $insert_buffer->insert($notification->create_insert_array($data, $pre_create_data));
// Users are needed to send notifications
$user_ids = array_merge($user_ids, $notification->users_to_query());
@@ -448,8 +449,7 @@ class phpbb_notification_manager
}
}
- // insert into the db
- $this->db->sql_multi_insert($this->notifications_table, $new_rows);
+ $insert_buffer->flush();
// We need to load all of the users to send notifications
$this->user_loader->load_users($user_ids);