aboutsummaryrefslogtreecommitdiffstats
path: root/admin/stats.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/stats.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 '')
-rw-r--r--admin/stats.php41
1 files changed, 13 insertions, 28 deletions
diff --git a/admin/stats.php b/admin/stats.php
index d6fd0235a..658d158c2 100644
--- a/admin/stats.php
+++ b/admin/stats.php
@@ -97,7 +97,7 @@ SELECT
$output = array();
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($output, $row);
+ $output[] = $row;
}
return $output;
@@ -226,7 +226,7 @@ SELECT *
if (isset($need_update[$key]))
{
$row['nb_pages'] += $need_update[$key];
- array_push($updates, $row);
+ $updates[] = $row;
unset($need_update[$key]);
}
}
@@ -236,16 +236,13 @@ foreach ($need_update as $time_key => $nb_pages)
{
$time_tokens = explode('-', $time_key);
- array_push(
- $inserts,
- array(
- 'year' => $time_tokens[0],
- 'month' => @$time_tokens[1],
- 'day' => @$time_tokens[2],
- 'hour' => @$time_tokens[3],
- 'nb_pages' => $nb_pages,
- )
- );
+ $inserts[] = array(
+ 'year' => $time_tokens[0],
+ 'month' => @$time_tokens[1],
+ 'day' => @$time_tokens[2],
+ 'hour' => @$time_tokens[3],
+ 'nb_pages' => $nb_pages,
+ );
}
if (count($updates) > 0)
@@ -323,10 +320,7 @@ $title_parts = array();
$url = PHPWG_ROOT_PATH.'admin.php?page=stats';
-array_push(
- $title_parts,
- '<a href="'.$url.'">'.l10n('Overall').'</a>'
- );
+$title_parts[] = '<a href="'.$url.'">'.l10n('Overall').'</a>';
$period_label = l10n('Year');
@@ -334,10 +328,7 @@ if (isset($page['year']))
{
$url.= '&amp;year='.$page['year'];
- array_push(
- $title_parts,
- '<a href="'.$url.'">'.$page['year'].'</a>'
- );
+ $title_parts[] = '<a href="'.$url.'">'.$page['year'].'</a>';
$period_label = l10n('Month');
}
@@ -346,10 +337,7 @@ if (isset($page['month']))
{
$url.= '&amp;month='.$page['month'];
- array_push(
- $title_parts,
- '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>'
- );
+ $title_parts[] = '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>';
$period_label = l10n('Day');
}
@@ -366,10 +354,7 @@ if (isset($page['day']))
$lang['day'][date('w', $time)]
);
- array_push(
- $title_parts,
- '<a href="'.$url.'">'.$day_title.'</a>'
- );
+ $title_parts[] = '<a href="'.$url.'">'.$day_title.'</a>';
$period_label = l10n('Hour');
}