From ae707279a1945e383c312cd648d288606a79e341 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 19 Oct 2013 17:43:04 +0000 Subject: remove all array_push (50% slower than []) + some changes missing for feature:2978 git-svn-id: http://piwigo.org/svn/trunk@25018 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/updates.class.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'admin/include/updates.class.php') diff --git a/admin/include/updates.class.php b/admin/include/updates.class.php index d25a75af7..5a1f48c70 100644 --- a/admin/include/updates.class.php +++ b/admin/include/updates.class.php @@ -161,7 +161,7 @@ class updates { if (in_array($ext_id, $conf['updates_ignored'][$type])) { - array_push($ignore_list, $ext_id); + $ignore_list[] = $ext_id; } else { @@ -248,7 +248,7 @@ class updates and $old_files = file(PHPWG_ROOT_PATH.$file, FILE_IGNORE_NEW_LINES) and !empty($old_files)) { - array_push($old_files, $file); + $old_files[] = $file; foreach($old_files as $old_file) { $path = PHPWG_ROOT_PATH.$old_file; @@ -314,7 +314,7 @@ class updates } else { - array_push($page['errors'], l10n('Unable to dump database.')); + $page['errors'][] = l10n('Unable to dump database.'); } } @@ -414,7 +414,8 @@ class updates unset($_SESSION['need_update']); if ($step == 2) { - array_push($page['infos'], l10n('Update Complete'), $upgrade_to); + $page['infos'][] = l10n('Update Complete'); + $page['infos'][] = $upgrade_to; $step = -1; } else @@ -425,24 +426,22 @@ class updates else { file_put_contents(PHPWG_ROOT_PATH.$conf['data_location'].'update/log_error.txt', $error); - array_push( - $page['errors'], - sprintf( - l10n('An error has occured during extract. Please check files permissions of your piwigo installation.
Click here to show log error.'), - get_root_url().$conf['data_location'].'update/log_error.txt' - ) - ); + + $page['errors'][] = l10n( + 'An error has occured during extract. Please check files permissions of your piwigo installation.
Click here to show log error.', + get_root_url().$conf['data_location'].'update/log_error.txt' + ); } } else { deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); - array_push($page['errors'], l10n('An error has occured during upgrade.')); + $page['errors'][] = l10n('An error has occured during upgrade.'); } } else { - array_push($page['errors'], l10n('Piwigo cannot retrieve upgrade file from server')); + $page['errors'][] = l10n('Piwigo cannot retrieve upgrade file from server'); } } } -- cgit v1.2.3