Ignore:
Timestamp:
12/14/12 14:30:35 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Melhorias de performance no codigo do Expresso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/class.so_userinterface.inc.php

    r6535 r7655  
    6363                $octets = explode('.', $ip); 
    6464                $output = array(); 
    65                 for ($i = 0; $i < 4; $i++) 
     65                for ($i = 0; $i < 4; ++$i) 
    6666                { 
    6767                        if ($bits >= 8) 
     
    123123 
    124124                        /* keep only associative elments and check if the user can access an intranet application */ 
    125                         for ($i = 0; $i < count($preOutput); $i++) 
     125                        for ($i = 0; $i < count($preOutput); ++$i) 
    126126                        { 
    127127                                if (($preOutput[$i]['intranet_only'] == '1') && (!$showIntranetApplications)) 
    128128                                        continue; 
    129129 
    130                                 for ($j = 0; $j < $result->_numOfFields; $j++) 
     130                                for ($j = 0; $j < $result->_numOfFields; ++$j) 
    131131                                        unset($preOutput[$i][$j]); 
    132132                                $output[] = $preOutput[$i]; 
     
    152152                        return false; 
    153153 
    154                 for ($i = 0; $i < $result->_numOfFields; $i++) 
     154                for ($i = 0; $i < $result->_numOfFields; ++$i) 
    155155                        unset($output[$i]); 
    156156 
     
    169169 
    170170                $output = $result->GetArray(-1); 
    171                 for ($i = 0; $i < count($output); $i++) 
    172                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     171                for ($i = 0; $i < count($output); ++$i) 
     172                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    173173                                unset($output[$i][$j]); 
    174174 
     
    196196 
    197197                $output = $result->GetArray(-1); 
    198                 for ($i = 0; $i < count($output); $i++) 
    199                 { 
    200                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     198                for ($i = 0; $i < count($output); ++$i) 
     199                { 
     200                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    201201                                unset($output[$i][$j]); 
    202202 
     
    218218 
    219219                $output = $result->GetArray(-1); 
    220                 for ($i = 0; $i < count($output); $i++) 
    221                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     220                for ($i = 0; $i < count($output); ++$i) 
     221                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    222222                                unset($output[$i][$j]); 
    223223 
     
    296296                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 
    297297                $categoriesCount = array(); 
    298                 for ($i = 0; $i < count($employees); $i++) 
     298                for ($i = 0; $i < count($employees); ++$i) 
    299299                { 
    300300                        /* remove numeric fields */ 
    301                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     301                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    302302                                unset($employees[$i][$j]); 
    303303                        if (!$this->authorized || !isset($employees[$i]['funcao'])) 
     
    396396                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    397397                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 
    398                 for ($i = 0; $i < count($employees); $i++) 
     398                for ($i = 0; $i < count($employees); ++$i) 
    399399                { 
    400400                        /* remove numeric fields */ 
    401                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     401                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    402402                                unset($employees[$i][$j]); 
    403403 
     
    434434 
    435435                if (count($searchTermExploded) > 0){ 
    436                         for ($i=1; $i<count($searchTermExploded); $i++) { 
     436                        for ($i=1; $i<count($searchTermExploded); ++$i) { 
    437437                                if (strlen($searchTermExploded[$i]) > 2) { 
    438438                                        $fullSearch = true; 
     
    454454                $ldapResult = array(); 
    455455 
    456                 for ($i = 0; $i < $entries['count']; $i++) 
     456                for ($i = 0; $i < $entries['count']; ++$i) 
    457457                        $ldapResult[$entries[$i]['uidnumber'][0]] = array('cn' => $entries[$i]['cn'][0], 'telephoneNumber' => $entries[$i]['telephonenumber'][0]); 
    458458 
     
    481481 
    482482                /* filling return array with employee's information */ 
    483                 for ($i = 0; $i < count($result); $i++) { 
     483                for ($i = 0; $i < count($result); ++$i) { 
    484484                        $employees []= array( 
    485485                                        'area'                          => $result[$i]['area'], 
     
    536536                /* creating the ldap query */ 
    537537                $ldap_query = '(&(|'; 
    538                 for ($i = 0; $i < count($result); $i++) { 
     538                for ($i = 0; $i < count($result); ++$i) { 
    539539                        $ldap_query .= '(uidNumber=' . $result[$i]['funcionario_id'] . ')'; 
    540540                } 
     
    547547                /* parsing result */ 
    548548                $ldapResult = array(); 
    549                 for ($i = 0; $i < $entries['count']; $i++) 
     549                for ($i = 0; $i < $entries['count']; ++$i) 
    550550                        $ldapResult[$entries[$i]['uidnumber'][0]] = array('cn' => $entries[$i]['cn'][0], 'telephoneNumber' => $entries[$i]['telephonenumber'][0]); 
    551551 
     
    556556                /* filling return array with employee's information */ 
    557557                $employees = array(); 
    558                 for ($i = 0; $i < count($result); $i++) { 
     558                for ($i = 0; $i < count($result); ++$i) { 
    559559 
    560560                        $employee = array(); 
     
    615615                $ldapResult = array(); 
    616616 
    617                 for ($i = 0; $i < $entries['count']; $i++) 
     617                for ($i = 0; $i < $entries['count']; ++$i) 
    618618                        $ldapResult[$entries[$i]['uidnumber'][0]] = array('cn' => $entries[$i]['cn'][0], 'telephoneNumber' => $entries[$i]['telephonenumber'][0]); 
    619619 
     
    642642 
    643643                /* filling return array with employee's information */ 
    644                 for ($i = 0; $i < count($result); $i++) { 
     644                for ($i = 0; $i < count($result); ++$i) { 
    645645                        $employees []= array( 
    646646                                        'area'                          => $result[$i]['area'], 
     
    707707 
    708708                $output = $result->GetArray(-1); 
    709                 for ($i = 0; $i < count($output); $i++) 
    710                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     709                for ($i = 0; $i < count($output); ++$i) 
     710                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    711711                                unset($output[$i][$j]); 
    712712 
     
    728728 
    729729                $output = $result->GetArray(-1); 
    730                 for ( $i = 0; $i < count($output); $i++ ) 
    731                 { 
    732                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     730                for ( $i = 0; $i < count($output); ++$i ) 
     731                { 
     732                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    733733                                unset($output[$i][$j]); 
    734734 
     
    759759 
    760760                $output = $result->GetArray( -1 ); 
    761                 for ( $i = 0; $i < count($output); $i++ ) 
    762                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     761                for ( $i = 0; $i < count($output); ++$i ) 
     762                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    763763                                unset($output[$i][$j]); 
    764764 
     
    795795 
    796796                $categoriesCount = array( ); 
    797                 for ( $i = 0; $i < count( $employees ); $i++ ) 
     797                for ( $i = 0; $i < count( $employees ); ++$i ) 
    798798                { 
    799799                        // remove numeric fields 
    800                         for ( $j = 0; $j < $result -> _numOfFields; $j++ ) 
     800                        for ( $j = 0; $j < $result -> _numOfFields; ++$j ) 
    801801                                unset( $employees[ $i ][ $j ] ); 
    802802 
     
    867867 
    868868                $categoriesCount = array( ); 
    869                 for ( $i = 0; $i < count( $employees ); $i++ ) 
     869                for ( $i = 0; $i < count( $employees ); ++$i ) 
    870870                { 
    871871                        // remove numeric fields 
    872                         for ( $j = 0; $j < $result -> _numOfFields; $j++ ) 
     872                        for ( $j = 0; $j < $result -> _numOfFields; ++$j ) 
    873873                                unset( $employees[ $i ][ $j ] ); 
    874874 
     
    893893 
    894894                // count the number of employees in each category 
    895                 for ( $i = 0; $i < count( $employees ); $i++ ) 
     895                for ( $i = 0; $i < count( $employees ); ++$i ) 
    896896                { 
    897897                        $categoryID = $employees[ $i ][ 'funcionario_categoria_id' ]; 
Note: See TracChangeset for help on using the changeset viewer.