Ignore:
Timestamp:
Oct 19, 2013, 7:43:04 PM (11 years ago)
Author:
mistic100
Message:

remove all array_push (50% slower than []) + some changes missing for feature:2978

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/stats.php

    r19703 r25018  
    9898  while ($row = pwg_db_fetch_assoc($result))
    9999  {
    100     array_push($output, $row);
     100    $output[] = $row;
    101101  }
    102102
     
    227227    {
    228228      $row['nb_pages'] += $need_update[$key];
    229       array_push($updates, $row);
     229      $updates[] = $row;
    230230      unset($need_update[$key]);
    231231    }
     
    237237  $time_tokens = explode('-', $time_key);
    238238
    239   array_push(
    240       $inserts,
    241       array(
    242         'year'     => $time_tokens[0],
    243         'month'    => @$time_tokens[1],
    244         'day'      => @$time_tokens[2],
    245         'hour'     => @$time_tokens[3],
    246         'nb_pages' => $nb_pages,
    247         )
    248       );
     239  $inserts[] = array(
     240    'year'     => $time_tokens[0],
     241    'month'    => @$time_tokens[1],
     242    'day'      => @$time_tokens[2],
     243    'hour'     => @$time_tokens[3],
     244    'nb_pages' => $nb_pages,
     245    );
    249246}
    250247
     
    324321$url = PHPWG_ROOT_PATH.'admin.php?page=stats';
    325322
    326 array_push(
    327   $title_parts,
    328   '<a href="'.$url.'">'.l10n('Overall').'</a>'
    329   );
     323$title_parts[] = '<a href="'.$url.'">'.l10n('Overall').'</a>';
    330324
    331325$period_label = l10n('Year');
     
    335329  $url.= '&amp;year='.$page['year'];
    336330
    337   array_push(
    338     $title_parts,
    339     '<a href="'.$url.'">'.$page['year'].'</a>'
    340     );
     331  $title_parts[] = '<a href="'.$url.'">'.$page['year'].'</a>';
    341332
    342333  $period_label = l10n('Month');
     
    347338  $url.= '&amp;month='.$page['month'];
    348339
    349   array_push(
    350     $title_parts,
    351     '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>'
    352     );
     340  $title_parts[] = '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>';
    353341
    354342  $period_label = l10n('Day');
     
    367355    );
    368356
    369   array_push(
    370     $title_parts,
    371     '<a href="'.$url.'">'.$day_title.'</a>'
    372     );
     357  $title_parts[] = '<a href="'.$url.'">'.$day_title.'</a>';
    373358
    374359  $period_label = l10n('Hour');
Note: See TracChangeset for help on using the changeset viewer.