diff options
author | mistic100 <mistic@piwigo.org> | 2013-10-19 17:43:04 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-10-19 17:43:04 +0000 |
commit | ae707279a1945e383c312cd648d288606a79e341 (patch) | |
tree | 917bdc6e0609ed0eefed5f3693de3a017685acc4 /admin/plugins_installed.php | |
parent | 35ff1b7c1f933799397a0ce0a6723cf82f416ff3 (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 '')
-rw-r--r-- | admin/plugins_installed.php | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/admin/plugins_installed.php b/admin/plugins_installed.php index 53a2ea110..2c195380e 100644 --- a/admin/plugins_installed.php +++ b/admin/plugins_installed.php @@ -64,7 +64,7 @@ if (isset($_GET['action']) and isset($_GET['plugin'])) { if (!is_webmaster()) { - array_push($page['errors'], l10n('Webmaster status is required.')); + $page['errors'][] = l10n('Webmaster status is required.'); } else { @@ -90,7 +90,7 @@ if (isset($_GET['incompatible_plugins'])) foreach ($plugins->get_incompatible_plugins() as $plugin => $version) { if ($plugin == '~~expire~~') continue; - array_push($incompatible_plugins, $plugin); + $incompatible_plugins[] = $plugin; } echo json_encode($incompatible_plugins); @@ -152,7 +152,7 @@ foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) $active_plugins++; } - array_push($tpl_plugins, $tpl_plugin); + $tpl_plugins[] = $tpl_plugin; } $template->append('plugin_states', 'active'); @@ -170,17 +170,14 @@ $missing_plugin_ids = array_diff( if (count($missing_plugin_ids) > 0) { - foreach($missing_plugin_ids as $plugin_id) + foreach ($missing_plugin_ids as $plugin_id) { - array_push( - $tpl_plugins, - array( - 'NAME' => $plugin_id, - 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], - 'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'), - 'U_ACTION' => sprintf($action_url, $plugin_id), - 'STATE' => 'missing', - ) + $tpl_plugins[] = array( + 'NAME' => $plugin_id, + 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], + 'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'), + 'U_ACTION' => sprintf($action_url, $plugin_id), + 'STATE' => 'missing', ); } $template->append('plugin_states', 'missing'); |