Changeset 9740


Ignore:
Timestamp:
03/17/11 13:16:19 (9 years ago)
Author:
patdenice
Message:

Minor optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/trunk/include/autoupdate.class.php

    r9729 r9740  
    6666    } 
    6767 
    68     // Extensionss to check 
     68    // Extensions to check 
    6969    $ext_to_check = array(); 
    7070    foreach ($this->types as $type) 
    7171    { 
    72       $ext_to_check[$type] = array(); 
    7372      $fs = 'fs_'.$type; 
    7473      foreach ($this->$type->$fs as $ext) 
     
    7675        if (isset($ext['extension'])) 
    7776        { 
    78           $ext_to_check[$type][] = $ext['extension']; 
     77          $ext_to_check[$ext['extension']] = $type; 
    7978        } 
    8079      } 
     
    9392    if (!empty($ext_to_check)) 
    9493    { 
    95       $extensions = array_merge($ext_to_check['plugins'], $ext_to_check['themes'], $ext_to_check['languages']); 
    96       $get_data['extension_include'] = implode(',', $extensions); 
     94      $get_data['extension_include'] = implode(',', array_keys($ext_to_check)); 
    9795    } 
    9896 
     
    106104      foreach ($pem_exts as $ext) 
    107105      { 
    108         foreach ($this->types as $type) 
     106        if (isset($ext_to_check[$ext['extension_id']])) 
    109107        { 
    110           if (in_array($ext['extension_id'], $ext_to_check[$type])) 
    111           { 
    112             $server = 'server_'.$type; 
    113             $this->$type->$server += array($ext['extension_id'] => $ext); 
    114             break; 
    115           } 
     108          $server = 'server_'.$ext_to_check[$ext['extension_id']]; 
     109          $this->$ext_to_check[$ext['extension_id']]->$server += array($ext['extension_id'] => $ext); 
    116110        } 
    117111      } 
Note: See TracChangeset for help on using the changeset viewer.