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/intro.php | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'admin/intro.php') diff --git a/admin/intro.php b/admin/intro.php index b8d6c8dd4..53fe33c9f 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -45,7 +45,7 @@ if (isset($_GET['action']) and 'check_upgrade' == $_GET['action']) { if (!fetchRemote(PHPWG_URL.'/download/latest_version', $result)) { - array_push($page['errors'], l10n('Unable to check for upgrade.')); + $page['errors'][] = l10n('Unable to check for upgrade.'); } else { @@ -73,33 +73,21 @@ if (isset($_GET['action']) and 'check_upgrade' == $_GET['action']) if ('' == $versions['latest']) { - array_push( - $page['errors'], - l10n('Check for upgrade failed for unknown reasons.') - ); + $page['errors'][] = l10n('Check for upgrade failed for unknown reasons.'); } // concatenation needed to avoid automatic transformation by release // script generator else if ('%'.'PWGVERSION'.'%' == $versions['current']) { - array_push( - $page['infos'], - l10n('You are running on development sources, no check possible.') - ); + $page['infos'][] = l10n('You are running on development sources, no check possible.'); } else if (version_compare($versions['current'], $versions['latest']) < 0) { - array_push( - $page['infos'], - l10n('A new version of Piwigo is available.') - ); + $page['infos'][] = l10n('A new version of Piwigo is available.'); } else { - array_push( - $page['infos'], - l10n('You are running the latest version of Piwigo.') - ); + $page['infos'][] = l10n('You are running the latest version of Piwigo.'); } } } @@ -201,12 +189,9 @@ $template->assign( 'DB_VERSION' => $db_version, 'DB_ELEMENTS' => l10n_dec('%d photo', '%d photos', $nb_elements), 'DB_CATEGORIES' => - l10n_dec('%d album including', '%d albums including', - $nb_categories). - l10n_dec('%d physical', '%d physicals', - $nb_physical). - l10n_dec(' and %d virtual', ' and %d virtuals', - $nb_virtual), + l10n_dec('%d album including', '%d albums including', $nb_categories). + l10n_dec('%d physical', '%d physicals', $nb_physical). + l10n_dec(' and %d virtual', ' and %d virtuals', $nb_virtual), 'DB_IMAGE_CATEGORY' => l10n_dec('%d association', '%d associations', $nb_image_category), 'DB_TAGS' => l10n_dec('%d tag', '%d tags', $nb_tags), 'DB_IMAGE_TAG' => l10n_dec('%d association', '%d associations', $nb_image_tag), -- cgit v1.2.3