aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/updates.class.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-10-19 17:43:04 +0000
committermistic100 <mistic@piwigo.org>2013-10-19 17:43:04 +0000
commitae707279a1945e383c312cd648d288606a79e341 (patch)
tree917bdc6e0609ed0eefed5f3693de3a017685acc4 /admin/include/updates.class.php
parent35ff1b7c1f933799397a0ce0a6723cf82f416ff3 (diff)
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
Diffstat (limited to 'admin/include/updates.class.php')
-rw-r--r--admin/include/updates.class.php25
1 files changed, 12 insertions, 13 deletions
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.<br><a href="%s">Click here to show log error</a>.'),
- 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.<br><a href="%s">Click here to show log error</a>.',
+ 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');
}
}
}