Ignore:
Timestamp:
12/18/12 16:15:29 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Correcoes para Performance: Function Within Loop Declaration.

Location:
trunk/expressoAdmin1_2/inc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.bomessages_size.inc.php

    r7655 r7673  
    285285                        $rules_tr = ''; 
    286286 
    287                         for ($i = 0; $i<count($rules); ++$i) 
     287            $rules_count = count($rules); 
     288                        for ($i = 0; $i<$rules_count; ++$i) 
    288289                        { 
    289290                                $name_link = (string)str_replace(" ", "%", $rules[$i]['email_recipient']); 
     
    311312                        $rules_tr = ''; 
    312313 
    313                         for ($i = 0; $i<count($rules); ++$i) 
     314            $rules_count = count($rules); 
     315                        for ($i = 0; $i<$rules_count; ++$i) 
    314316                        { 
    315317                                $name_link = (string)str_replace(" ", "%", $rules[$i]['email_recipient']); 
  • trunk/expressoAdmin1_2/inc/class.bosectors.inc.php

    r7655 r7673  
    162162                        $sector_users = $this->so->get_sector_users($sector_dn); 
    163163 
    164                         for ($i=0; $i<count($sector_users)-1; ++$i) 
     164            $sector_users_count = count($sector_users)-1; 
     165                        for ($i=0; $i<$sector_users_count; ++$i) 
    165166                        { 
    166167                                //_debug_array($user); 
     
    174175 
    175176                        $sector_groups = $this->so->get_sector_groups($sector_dn); 
    176                         for ($i=0; $i<count($sector_groups)-1; ++$i) 
     177            $sector_groups_count = count($sector_groups)-1; 
     178                        for ($i=0; $i<$sector_groups_count; ++$i) 
    177179                        { 
    178180                                $dn = $sector_groups[$i]['dn']; 
  • trunk/expressoAdmin1_2/inc/class.db_functions.inc.php

    r7655 r7673  
    141141                 
    142142                //Escrevre no Banco as aplicações que o gerente tem direito de disponibilizar aos seus usuarios. 
    143                 for ($i=0; $i<count($aplications); ++$i) 
     143        $aplications_count = count($aplications); 
     144                for ($i=0; $i<$aplications_count; ++$i) 
    144145                { 
    145146                        $sql = "INSERT INTO phpgw_expressoadmin_apps (manager_lid, context, app) " 
     
    415416                while($this->db->next_record()) 
    416417                        $user_app[] = $this->db->row(); 
    417                  
    418                 for ($i=0; $i<count($user_app); ++$i) 
     418 
     419        $user_app_count = count($user_app); 
     420                for ($i=0; $i<$user_app_count; ++$i) 
    419421                        $return['groups'][] = $user_app[$i]['acl_location']; 
    420422                 
  • trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php

    r7655 r7673  
    15711571                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    15721572                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    1573                                 for($i=1; $i<count($sector_dn_array); ++$i) 
     1573                $sector_dn_array_count = count($sector_dn_array); 
     1574                                for($i=1; $i<$sector_dn_array_count; ++$i) 
    15741575                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    15751576                                //Retira ultimo pipe. 
     
    16981699                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    16991700                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    1700                                 for($i=1; $i<count($sector_dn_array); ++$i) 
     1701                $sector_dn_array_count = count($sector_dn_array); 
     1702                                for($i=1; $i<$sector_dn_array_count; ++$i) 
    17011703                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    17021704                                //Retira ultimo pipe. 
     
    18311833                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    18321834                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    1833                                 for($i=1; $i<count($sector_dn_array); ++$i) 
     1835                $sector_dn_array_count = count($sector_dn_array); 
     1836                                for($i=1; $i<$sector_dn_array_count; ++$i) 
    18341837                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    18351838                                //Retira ultimo pipe. 
     
    19291932                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    19301933                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    1931                                 for($i=1; $i<count($sector_dn_array); ++$i) 
     1934                $sector_dn_array_count = count($sector_dn_array); 
     1935                                for($i=1; $i<$sector_dn_array_count; ++$i) 
    19321936                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    19331937                                //Retira ultimo pipe. 
     
    20012005                                $entry[0]['dn'] = strtolower($entry[0]['dn']); 
    20022006                                $sector_dn_array = explode(",", $entry[0]['dn']); 
    2003                                 for($i=1; $i<count($sector_dn_array); ++$i) 
     2007                $sector_dn_array_count = count($sector_dn_array); 
     2008                                for($i=1; $i<$sector_dn_array_count; ++$i) 
    20042009                                        $sector_dn .= $sector_dn_array[$i] . ','; 
    20052010                                //Retira ultimo pipe. 
  • trunk/expressoAdmin1_2/inc/class.socomputers.inc.php

    r7655 r7673  
    8686                                        // Recupera o contexto do email_list 
    8787                                        $tmp = explode(",", $computer_data['dn']); 
    88                                         for ($i = 1; $i < count($tmp); ++$i) 
     88                    $tmp_count = count($tmp); 
     89                                        for ($i = 1; $i < $tmp_count; ++$i) 
    8990                                                $computer_data['context'] .= $tmp[$i] . ','; 
    9091                                        $computer_data['context'] = substr($computer_data['context'],0,(strlen($computer_data['context']) - 1)); 
  • trunk/expressoAdmin1_2/inc/class.uimessages_size.inc.php

    r7655 r7673  
    114114                        $rules = ''; 
    115115            $all_rules = $this->bo->get_all_rules(); 
    116                          
    117                         for ($i = 0; $i<count($all_rules); ++$i) 
     116 
     117            $all_rules_count = count($all_rules); 
     118                        for ($i = 0; $i<$all_rules_count; ++$i) 
    118119                        {        
    119120                                /* Verificação para não listar a regra default */ 
Note: See TracChangeset for help on using the changeset viewer.