From 5a5a7eb2f442fdedcc916009600aedf6e105a105 Mon Sep 17 00:00:00 2001 From: nickw Date: Tue, 10 Nov 2009 21:27:46 +0000 Subject: Using php default functions instead of ElggUser in upgrade script. Large Elgg sites could not handle the "select * from users" query without hitting memory limit. git-svn-id: http://code.elgg.org/elgg/trunk@3662 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/upgrades/2009102801.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/lib/upgrades/2009102801.php b/engine/lib/upgrades/2009102801.php index 01d7a9ad2..23149e5c5 100644 --- a/engine/lib/upgrades/2009102801.php +++ b/engine/lib/upgrades/2009102801.php @@ -177,9 +177,8 @@ function user_file_matrix($guid) { /** Upgrade file locations */ -// loop over all users -$users = get_data("SELECT * FROM {$CONFIG->dbprefix}users_entity"); -foreach ($users as $user) { +$users = mysql_query("SELECT guid, username FROM {$CONFIG->dbprefix}users_entity"); +while ($user = mysql_fetch_object($users)) { $to = $CONFIG->dataroot . user_file_matrix($user->guid); foreach (array('1_0', '1_1', '1_6') as $version) { $function = "file_matrix_$version"; -- cgit v1.2.3