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/include/updates.class.php

    r23821 r25018  
    162162            if (in_array($ext_id, $conf['updates_ignored'][$type]))
    163163            {
    164               array_push($ignore_list, $ext_id);
     164              $ignore_list[] = $ext_id;
    165165            }
    166166            else
     
    249249      and !empty($old_files))
    250250    {
    251       array_push($old_files, $file);
     251      $old_files[] = $file;
    252252      foreach($old_files as $old_file)
    253253      {
     
    315315    else
    316316    {
    317       array_push($page['errors'], l10n('Unable to dump database.'));
     317      $page['errors'][] = l10n('Unable to dump database.');
    318318    }
    319319  }
     
    415415            if ($step == 2)
    416416            {
    417               array_push($page['infos'], l10n('Update Complete'), $upgrade_to);
     417              $page['infos'][] = l10n('Update Complete');
     418              $page['infos'][] = $upgrade_to;
    418419              $step = -1;
    419420            }
     
    426427          {
    427428            file_put_contents(PHPWG_ROOT_PATH.$conf['data_location'].'update/log_error.txt', $error);
    428             array_push(
    429               $page['errors'],
    430               sprintf(
    431                 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>.'),
    432                 get_root_url().$conf['data_location'].'update/log_error.txt'
    433               )
    434             );
     429           
     430            $page['errors'][] = l10n(
     431              '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>.',
     432              get_root_url().$conf['data_location'].'update/log_error.txt'
     433              );
    435434          }
    436435        }
     
    438437        {
    439438          deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update');
    440           array_push($page['errors'], l10n('An error has occured during upgrade.'));
     439          $page['errors'][] = l10n('An error has occured during upgrade.');
    441440        }
    442441      }
    443442      else
    444443      {
    445         array_push($page['errors'], l10n('Piwigo cannot retrieve upgrade file from server'));
     444        $page['errors'][] = l10n('Piwigo cannot retrieve upgrade file from server');
    446445      }
    447446    }
Note: See TracChangeset for help on using the changeset viewer.