Changeset 7655 for trunk/workflow


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

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

Location:
trunk/workflow
Files:
75 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/controller.php

    r3167 r7655  
    3030                        $count_files = $_POST['countFiles']; 
    3131                        $array_files = array();                  
    32                         for($idx = 1; $idx <= $count_files; $idx++) {            
     32                        for($idx = 1; $idx <= $count_files; ++$idx) { 
    3333                                if($_FILES['file_'.$idx] && !$_FILES['file_'.$idx]['error']) 
    3434                                        $array_files[] = $_FILES['file_'.$idx];                                           
  • trunk/workflow/inc/class.BrowserInfo.inc.php

    r5934 r7655  
    304304                $required = explode('.', $version); 
    305305                $current = explode('.', $this->getBrowserVersion()); 
    306                 for ($i = 0; $i < count($required); $i++) 
     306                for ($i = 0; $i < count($required); ++$i) 
    307307                { 
    308308                        $subRequired = (int) $required[$i]; 
  • trunk/workflow/inc/class.JobScheduler.inc.php

    r4728 r7655  
    111111                { 
    112112                        $active = false; 
    113                         for ($i = 0; ($i < $numerOfJobs) && !$active; $i++) 
     113                        for ($i = 0; ($i < $numerOfJobs) && !$active; ++$i) 
    114114                                $active = $active || $runningJobs[$i]->isActive(); 
    115115                        usleep($timeStep); 
     
    120120                while ($active); 
    121121 
    122                 for ($i = 0; $i < $numerOfJobs; $i++) 
     122                for ($i = 0; $i < $numerOfJobs; ++$i) 
    123123                { 
    124124                        if (!$runningJobs[$i]->isActive()) 
  • trunk/workflow/inc/class.Paging.inc.php

    r795 r7655  
    124124                        $end = min($start + $this->itemsPerPage, $totalItems); 
    125125                        $this->items = array(); 
    126                         for ($i = $start; $i < $end; $i++) 
     126                        for ($i = $start; $i < $end; ++$i) 
    127127                                $this->items[] = $pItems[$i]; 
    128128                } 
     
    147147                $charSeparator = empty($this->newRequest) ? "" : "&amp;"; 
    148148 
    149                 for ($i = 0; $i < $this->numberOfPages; $i++) 
     149                for ($i = 0; $i < $this->numberOfPages; ++$i) 
    150150                { 
    151151                        $page = $i; 
     
    178178                $firstPage = max(0, $this->currentPage - $numberOfLinks); 
    179179                $lastPage = min($this->currentPage + $numberOfLinks, $this->numberOfPages); 
    180                 for ($i = $firstPage; $i < $lastPage; $i++) 
     180                for ($i = $firstPage; $i < $lastPage; ++$i) 
    181181                        $output[] = $allPaginationResults[$i]; 
    182182 
     
    225225                } 
    226226 
    227                 for ($i = 0; $i < count($paginationLinks); $i++) 
     227                for ($i = 0; $i < count($paginationLinks); ++$i) 
    228228                { 
    229229                        $tmp = $paginationLinks[$i]; 
  • trunk/workflow/inc/class.WorkflowLDAP.inc.php

    r3729 r7655  
    171171                { 
    172172                        $attributes = ldap_get_attributes($this->dataSource, $entry); 
    173                         for ($i = 0; $i < $attributes['count']; $i++) 
     173                        for ($i = 0; $i < $attributes['count']; ++$i) 
    174174                                $output[$counter][$attributes[$i]] = ldap_get_values_len($this->dataSource, $entry, $attributes[$i]); 
    175175 
    176                         $counter++; 
     176                        ++$counter; 
    177177                } while ($entry = ldap_next_entry($this->dataSource, $entry)); 
    178178 
     
    201201 
    202202                $output = array(); 
    203                 for ($i = 0; $i < $result['count']; $i++) 
     203                for ($i = 0; $i < $result['count']; ++$i) 
    204204                { 
    205205                        $output[] = array( 
     
    249249                $resourceIdentifier = ldap_search($this->dataSource, $this->groupContext, "(&(phpgwaccounttype=g)(memberuid={$userLogin}))", array('gidnumber')); 
    250250                $result = ldap_get_entries($this->dataSource, $resourceIdentifier); 
    251                 for ($i = 0; $i < $result['count']; $i++) 
     251                for ($i = 0; $i < $result['count']; ++$i) 
    252252                        $output[] = $result[$i]['gidnumber'][0]; 
    253253 
     
    295295                $output = array(); 
    296296                $userCount = count($result); 
    297                 for ($i = 0; $i < $userCount; $i++) 
     297                for ($i = 0; $i < $userCount; ++$i) 
    298298                        $output[] = array( 
    299299                                'account_id' => $result[$i]['uidnumber'][0], 
     
    356356                /* collect the data */ 
    357357                $output = array(); 
    358                 for ($i = 0; $i < $result['count']; $i++) 
     358                for ($i = 0; $i < $result['count']; ++$i) 
    359359                { 
    360360                        $output[] = array( 
     
    572572                $output = array(); 
    573573                $entityCount = count($result); 
    574                 for ($i = 0; $i < $entityCount; $i++) 
     574                for ($i = 0; $i < $entityCount; ++$i) 
    575575                        $output[] = array( 
    576576                                'id' => ($result[$i]['phpgwaccounttype'][0] == 'g') ? $result[$i]['gidnumber'][0] : $result[$i]['uidnumber'][0], 
     
    631631 
    632632                $output = array(); 
    633                 for ($i = 0; $i < $result['count']; $i++) 
     633                for ($i = 0; $i < $result['count']; ++$i) 
    634634                        $output[] = array( 
    635635                                'id' => ($result[$i]['phpgwaccounttype'][0] == 'g') ? $result[$i]['gidnumber'][0] : $result[$i]['uidnumber'][0], 
  • trunk/workflow/inc/class.bo_adminsource.inc.php

    r3167 r7655  
    8080                { 
    8181                        $value /= 1024.0; 
    82                         $unitSelect++; 
     82                        ++$unitSelect; 
    8383                } 
    8484 
  • trunk/workflow/inc/class.bo_monitors.inc.php

    r5921 r7655  
    349349                $instanceCount = count($output['data']); 
    350350                $cachedLDAP = &Factory::getInstance('CachedLDAP'); 
    351                 for ($i = 0; $i < $instanceCount; $i++) 
     351                for ($i = 0; $i < $instanceCount; ++$i) 
    352352                { 
    353353                        /* get the user name */ 
     
    489489                $userMapping = array(); 
    490490                $instanceCount = count($output['data']); 
    491                 for ($i = 0; $i < $instanceCount; $i++) 
     491                for ($i = 0; $i < $instanceCount; ++$i) 
    492492                { 
    493493                        /* get the user name */ 
     
    727727                        foreach ($rawData['data'] as $instance) 
    728728                                if ($this->processMonitor->remove_instance($instance['wf_instance_id'])) 
    729                                         $instanceCount++; 
     729                                        ++$instanceCount; 
    730730                return $instanceCount; 
    731731        } 
     
    12021202                        { 
    12031203                                if ($this->instanceManager->set_instance_user($instance['wf_instance_id'], $instance['wf_activity_id'], $newUser)) 
    1204                                         $OKCount++; 
     1204                                        ++$OKCount; 
    12051205                                else 
    1206                                         $errorCount++; 
     1206                                        ++$errorCount; 
    12071207                        } 
    12081208                } 
     
    14311431                        $phpMailer->AddAddress($email['to'], $email['username']); 
    14321432                        if ($phpMailer->Send()) 
    1433                                 $count++; 
     1433                                ++$count; 
    14341434                } 
    14351435                return $count; 
  • trunk/workflow/inc/class.bo_userinterface.inc.php

    r5921 r7655  
    846846 
    847847                $areas = $this->so->getAreaList($this->organizationInfo['organizacao_id']); 
    848                 for ($i = 0; $i < count($areas); $i++) 
     848                for ($i = 0; $i < count($areas); ++$i) 
    849849                { 
    850850                        $areas[$i]['children'] = false; 
  • trunk/workflow/inc/class.external_bridge.inc.php

    r3167 r7655  
    150150                /* encode the form before submission */ 
    151151                $encodedForm = ''; 
    152                 for ($i = 0; $i < strlen($generatedForm); $i++) 
     152                for ($i = 0; $i < strlen($generatedForm); ++$i) 
    153153                        $encodedForm .= '%' . bin2hex($generatedForm[$i]); 
    154154                $encodedForm = '<script type="text/javascript">eval(unescape(\'' . $encodedForm . '\'))</script>'; 
  • trunk/workflow/inc/class.powergraphic.inc.php

    r6037 r7655  
    405405 
    406406            unset($temp[$index]); 
    407             $i++; 
     407            ++$i; 
    408408        } 
    409409 
     
    464464            imagestring($this->img, 3, ($this->graphic_area_x1-$less-7), ($higher_value_y-7), $this->higher_value_str, $this->color['axis_values']); 
    465465 
    466             for ($i = 1; $i < 10; $i++) 
     466            for ($i = 1; $i < 10; ++$i) 
    467467            { 
    468468                $dec_y = $i * ($higher_value_size / 10); 
     
    503503            imagestring($this->img, 3, (($this->graphic_area_x1+$higher_value_size) - ($this->string_width($this->higher_value, 3)/2)), ($this->graphic_area_y2+2), $this->higher_value_str, $this->color['axis_values']); 
    504504 
    505             for ($i = 1, $alt = 15; $i < 10; $i++) 
     505            for ($i = 1, $alt = 15; $i < 10; ++$i) 
    506506            { 
    507507                $dec_x = number_format(round($i * ($higher_value_size  / 10), 1), 1, ".", ""); 
     
    561561                $y2   = $this->graphic_area_y2 - 1; 
    562562                $x   += $this->space_between_bars; 
    563                 $num++; 
     563                ++$num; 
    564564 
    565565                imageline($this->img, ($x1+1), ($y1-1), $x2, ($y1-1), $this->color['bars_shadow']); 
     
    950950                imagestring($this->img, 2, ($x2-$less), ($y-2), $percent, $this->color['axis_values']); 
    951951                $y += 14; 
    952                 $num++; 
     952                ++$num; 
    953953            } 
    954954        } 
     
    12811281    <span style="margin-left: 40px;">Parameter</span>  
    12821282    <span style="margin-left: 50px;">Value 1</span>  <span id="value_2" style="display: none; margin-left: 25px;">Value 2</span>'; 
    1283         for ($i = 0; $i <= 4; $i++) { 
     1283        for ($i = 0; $i <= 4; ++$i) { 
    12841284            echo '<div style="margin-left: 8px;"> '.($i+1).'. <input type="text" name="x'.$i.'" id="x'.$i.'" size="20" /> '; 
    12851285            echo ' <input type="text" name="y'.$i.'" id="y'.$i.'" size="10" onkeypress="return numbers();" /> '; 
  • trunk/workflow/inc/class.so_adminaccess.inc.php

    r7495 r7655  
    226226                $tmpBin = decbin($number); 
    227227                $tmpSize = strlen($tmpBin); 
    228                 for ($i = 0; $i < $tmpSize; $i++) 
     228                for ($i = 0; $i < $tmpSize; ++$i) 
    229229                        $levelList[$tmpSize - $i - 1] = ($tmpBin[$i] == '0') ? false : true; 
    230230 
     
    244244 
    245245                $text = ""; 
    246                 for ($i = 0; $i < $this->numberOfPermissions; $i++) 
     246                for ($i = 0; $i < $this->numberOfPermissions; ++$i) 
    247247                        if (isset($list[$i])) 
    248248                                $text = (($list[$i] == true) ? '1' : '0') . $text; 
  • trunk/workflow/inc/class.so_external_applications.inc.php

    r3167 r7655  
    148148 
    149149                $output = $result->GetArray(-1); 
    150                 for ($i = 0; $i < count($output); $i++) 
    151                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     150                for ($i = 0; $i < count($output); ++$i) 
     151                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    152152                                unset($output[$i][$j]); 
    153153 
     
    170170 
    171171                $output = $result->GetArray(-1); 
    172                 for ($i = 0; $i < count($output); $i++) 
    173                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     172                for ($i = 0; $i < count($output); ++$i) 
     173                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    174174                                unset($output[$i][$j]); 
    175175 
  • trunk/workflow/inc/class.so_orgchart.inc.php

    r7495 r7655  
    152152 
    153153                $output = $result->GetArray(-1); 
    154                 for ($i = 0; $i < count($output); $i++) 
    155                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     154                for ($i = 0; $i < count($output); ++$i) 
     155                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    156156                                unset($output[$i][$j]); 
    157157 
     
    308308 
    309309                $output = $result->GetArray(-1); 
    310                 for ($i = 0; $i < count($output); $i++) 
    311                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     310                for ($i = 0; $i < count($output); ++$i) 
     311                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    312312                                unset($output[$i][$j]); 
    313313 
     
    385385 
    386386                $output = $result->GetArray(-1); 
    387                 for ($i = 0; $i < count($output); $i++) 
    388                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     387                for ($i = 0; $i < count($output); ++$i) 
     388                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    389389                                unset($output[$i][$j]); 
    390390 
     
    462462 
    463463                $output = $result->GetArray(-1); 
    464                 for ($i = 0; $i < count($output); $i++) 
    465                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     464                for ($i = 0; $i < count($output); ++$i) 
     465                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    466466                                unset($output[$i][$j]); 
    467467 
     
    541541 
    542542                $output = $result->GetArray(-1); 
    543                 for ($i = 0; $i < count($output); $i++) 
    544                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     543                for ($i = 0; $i < count($output); ++$i) 
     544                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    545545                                unset($output[$i][$j]); 
    546546 
     
    623623 
    624624                $output = $result->GetArray(-1); 
    625                 for ($i = 0; $i < count($output); $i++){ 
    626                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     625                for ($i = 0; $i < count($output); ++$i){ 
     626                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    627627                                unset($output[$i][$j]); 
    628628                        $output[$i]['centro_custo_id'] = empty($output[$i]['centro_custo_id']) ? 'NULL' : $output[$i]['centro_custo_id']; 
     
    714714                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    715715                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 
    716                 for ($i = 0; $i < count($output); $i++) 
     716                for ($i = 0; $i < count($output); ++$i) 
    717717                { 
    718718                        $output[$i]['funcionario_id_desc'] = ''; 
     
    771771                        die(serialize("O sistema de busca não pode ser utilizado nesta organização.")); 
    772772                $entries = ldap_get_entries($ldap, $list); 
    773                 for ($i=0; $i < $entries['count']; $i++) 
     773                for ($i=0; $i < $entries['count']; ++$i) 
    774774                        $unifiedResult[$entries[$i]['uidnumber'][0]] = array('name' => $entries[$i]['cn'][0], 'uid' => $entries[$i]['uid'][0], 'removed' => false); 
    775775 
     
    790790 
    791791                $output = $result->GetArray(-1); 
    792                 for ($i = 0; $i < count($output); $i++) 
    793                 { 
    794                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     792                for ($i = 0; $i < count($output); ++$i) 
     793                { 
     794                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    795795                                unset($output[$i][$j]); 
    796796                        $output[$i]['funcionario_id_desc'] = $unifiedResult[$output[$i]['funcionario_id']]['name']; 
     
    964964                while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) 
    965965                { 
    966                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     966                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    967967                                unset($row[$j]); 
    968968                        $row['substituto_funcionario_id_desc'] = ($row['substituto_funcionario_id'] != '') ? $ldap->getName($row['substituto_funcionario_id']) : ''; 
     
    10031003 
    10041004                $output = $result->GetArray(-1); 
    1005                 for ($i = 0; $i < count($output); $i++) 
    1006                 { 
    1007                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     1005                for ($i = 0; $i < count($output); ++$i) 
     1006                { 
     1007                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    10081008                                unset($output[$i][$j]); 
    10091009 
     
    13841384 
    13851385                $output = $result->GetArray(-1); 
    1386                 for ($i = 0; $i < count($output); $i++) 
    1387                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     1386                for ($i = 0; $i < count($output); ++$i) 
     1387                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    13881388                                unset($output[$i][$j]); 
    13891389 
     
    15861586 
    15871587                $output = $result->GetArray(-1); 
    1588                 for ($i = 0; $i < count($output); $i++) { 
    1589                         for ($j = 0; $j < $result->_numOfFields; $j++) 
     1588                for ($i = 0; $i < count($output); ++$i) { 
     1589                        for ($j = 0; $j < $result->_numOfFields; ++$j) 
    15901590                                unset($output[$i][$j]); 
    15911591 
  • 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' ]; 
  • trunk/workflow/inc/class.ui_adminactivities.inc.php

    r3167 r7655  
    647647        { 
    648648                $num_activities = count($process_activities['data']); 
    649                 for ($i=0; $i < $num_activities; $i++) 
     649                for ($i=0; $i < $num_activities; ++$i) 
    650650                { 
    651651                        $act_id = $process_activities['data'][$i]['wf_activity_id']; 
     
    695695        function search_transitions_act(&$process_activities, $act_id) 
    696696        { 
    697                 for ($i=0; $i < $process_activities['cant']; $i++) 
     697                for ($i=0; $i < $process_activities['cant']; ++$i) 
    698698                { 
    699699                        $id = $process_activities['data'][$i]['wf_activity_id']; 
  • trunk/workflow/inc/class.ui_adminprocesses.inc.php

    r3167 r7655  
    428428 
    429429                                        reset($config_type); 
    430                                         for($i = 0; ($current =& each($config_type) != null); $i++){ 
     430                                        for($i = 0; ($current =& each($config_type) != null); ++$i){ 
    431431                                                $this->t->set_var(array( 
    432432                                                        'config_option_name'            => $current['value'], 
  • trunk/workflow/inc/class.ui_orgchart.inc.php

    r3255 r7655  
    152152 
    153153                        $ldap = &Factory::getInstance('WorkflowLDAP'); 
    154                         for ($i = 0; $i < count($output); $i++) 
     154                        for ($i = 0; $i < count($output); ++$i) 
    155155                        { 
    156                                 for ($j = 0; $j < $result->_numOfFields; $j++) 
     156                                for ($j = 0; $j < $result->_numOfFields; ++$j) 
    157157                                        unset($output[$i][$j]); 
    158158                                if ($output[$i]['titular_funcionario_id'] != '') 
     
    162162                                        $supervisorArray = explode(' ', $supervisor); 
    163163                                        $supervisorName = ''; 
    164                                         for ($j = 0; $j < count($supervisorArray); $j++) 
     164                                        for ($j = 0; $j < count($supervisorArray); ++$j) 
    165165                                                $supervisorName .= (($j == 0) || ($j == count($supervisorArray) - 1)) ? $supervisorArray[$j] . ' ' : $supervisorArray[$j][0] . '. '; 
    166166                                        $supervisorName = trim(str_replace("Junior", "Jr", $supervisorName)); 
  • trunk/workflow/inc/class.utils.php

    r5934 r7655  
    143143                                if ($i < ($size-1) && !is_array($base)) 
    144144                                        return $fallback; 
    145                                 $i++; 
     145                                ++$i; 
    146146                        } 
    147147                        return $base; 
  • trunk/workflow/inc/class.utils.security.php

    r5928 r7655  
    6868        function SecurityUtils($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) { 
    6969                // make sure user defined arrays are in lowercase 
    70                 for ($i = 0; $i < count($tagsArray); $i++) $tagsArray[$i] = strtolower($tagsArray[$i]); 
    71                 for ($i = 0; $i < count($attrArray); $i++) $attrArray[$i] = strtolower($attrArray[$i]); 
     70                for ($i = 0; $i < count($tagsArray); ++$i) $tagsArray[$i] = strtolower($tagsArray[$i]); 
     71                for ($i = 0; $i < count($attrArray); ++$i) $attrArray[$i] = strtolower($attrArray[$i]); 
    7272                // assign to member vars 
    7373                $this->tagsArray = (array) $tagsArray; 
     
    110110                while($source != $this->filterTags($source)) { 
    111111                        $source = $this->filterTags($source); 
    112                         $loopCounter++; 
     112                        ++$loopCounter; 
    113113                } 
    114114                return $source; 
     
    135135                $newSet = array(); 
    136136                // process attributes 
    137                 for ($i = 0; $i <count($attrSet); $i++) { 
     137                for ($i = 0; $i <count($attrSet); ++$i) { 
    138138                        // skip blank spaces in tag 
    139139                        if (!$attrSet[$i]) continue; 
  • trunk/workflow/inc/class.utils.string.php

    r5934 r7655  
    481481                if (!empty($str)) { 
    482482                        $w = preg_split("/\s+/", $str); 
    483                         for ($i=0, $s=sizeof($w); $i<$s; $i++) { 
     483                        for ($i=0, $s=sizeof($w); $i<$s; ++$i) { 
    484484                                if (empty($w[$i])) 
    485485                                        continue; 
     
    631631                $processed = ''; 
    632632                $paragraphs = explode("\n", $str); 
    633                 for ($i=0; $i<sizeof($paragraphs); $i++) { 
     633                for ($i=0; $i<sizeof($paragraphs); ++$i) { 
    634634                        $processed .= $this->wrapLine($paragraphs[$i], $num, $breakString) . $breakString; 
    635635                } 
     
    656656                $indent = max($width, $indent); 
    657657                // gera a numeraᅵᅵo de linhas da string 
    658                 for ($i = 0; $i < $size; $i++) { 
     658                for ($i = 0; $i < $size; ++$i) { 
    659659                        $line[$i] = str_pad((string)($i + $start), $indent, ' ', STR_PAD_LEFT) . $afterNumberChar . ' ' . trim($line[$i]); 
    660660                } 
  • trunk/workflow/inc/class.utils.type.php

    r795 r7655  
    104104                                        return TRUE; 
    105105                                } 
    106                                 $i++; 
     106                                ++$i; 
    107107                        } 
    108108                } 
  • trunk/workflow/inc/class.utils.xml.php

    r795 r7655  
    203203                static $attrLevel = -1; 
    204204                static $fnstAttr = TRUE; 
    205                 $attrLevel++; 
     205                ++$attrLevel; 
    206206                // built $this->track; 
    207207                $this->track[] = $tag; 
  • trunk/workflow/inc/class.workflow_processmanager.inc.php

    r3167 r7655  
    390390                        $transitions=Array(); 
    391391                        $jobs = array(); 
    392                         for($i=0;$i<count($this->tree[1]['children']);$i++) { 
     392            $tree_count = count($this->tree[1]['children']); 
     393                        for($i=0;$i<$tree_count;++$i) { 
    393394                          // Process attributes 
    394395                          $z=$this->tree[1]['children'][$i]; 
     
    397398                          //config values 
    398399                          if ($name=='configs') { 
    399                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     400                $tree_z_count = count($this->tree[$z]['children']); 
     401                                for($j=0;$j<$tree_z_count;++$j) { 
    400402                                  $z2 = $this->tree[$z]['children'][$j]; 
    401403                                  // this is a config $name = $this->tree[$z2]['name']; 
    402404                                  $aux = Array(); 
    403405                                  if($this->tree[$z2]['name']=='config') { 
    404                                         for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     406                    $tree_z_count = count($this->tree[$z2]['children']); 
     407                                        for($k=0;$k<$tree_z_count;++$k) { 
    405408                                          $z3 = $this->tree[$z2]['children'][$k]; 
    406409                                          $name = trim($this->tree[$z3]['name']); 
     
    414417                          //activities 
    415418                          elseif($name=='activities') { 
    416                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     419                $tree_z_count = count($this->tree[$z]['children']); 
     420                                for($j=0;$j<$tree_z_count;++$j) { 
    417421                                  $z2 = $this->tree[$z]['children'][$j]; 
    418422                                  // this is an activity $name = $this->tree[$z2]['name']; 
    419423                                  $aux = Array(); 
    420424                                  if($this->tree[$z2]['name']=='activity') { 
    421                                         for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     425                    $tree_z2_count = count($this->tree[$z2]['children']); 
     426                                        for($k=0;$k<$tree_z2_count;++$k) { 
    422427                                          $z3 = $this->tree[$z2]['children'][$k]; 
    423428                                          $name = trim($this->tree[$z3]['name']); 
     
    425430                                          if($name=='roles') { 
    426431                                                $roles=Array(); 
    427                                                 for($l=0;$l<count($this->tree[$z3]['children']);$l++) { 
     432                        $tree_z3_count = count($this->tree[$z3]['children']); 
     433                                                for($l=0;$l<$tree_z3_count;++$l) { 
    428434                                                  $z4 = $this->tree[$z3]['children'][$l]; 
    429435                                                  $name = trim($this->tree[$z4]['name']); 
     
    445451                                          { 
    446452                                                $agents=Array(); 
    447                                                 for($l=0;$l<count($this->tree[$z3]['children']);$l++)  
     453                        $tree_z3_count = count($this->tree[$z3]['children']); 
     454                                                for($l=0;$l<$tree_z3_count;++$l) 
    448455                                                { 
    449456                                                  $z4 = $this->tree[$z3]['children'][$l]; 
     
    453460                                                  { 
    454461                                                        $agent = array(); 
    455                                                         for($m=0;$m<count($this->tree[$z4]['children']);$m++) 
     462                            $tree_z4_count = count($this->tree[$z4]['children']); 
     463                                                        for($m=0;$m<$tree_z4_count;++$m) 
    456464                                                        { 
    457465                                                          $z5 = $this->tree[$z4]['children'][$m]; 
     
    466474                                                          elseif ($name=='agent_datas')  
    467475                                                          { 
    468                                                                 for($n=0;$n<count($this->tree[$z5]['children']);$n++) 
     476                                $tree_z5_count = count($this->tree[$z5]['children']); 
     477                                                                for($n=0;$n<$tree_z5_count;++$n) 
    469478                                                                { 
    470479                                                                  $z6 = $this->tree[$z5]['children'][$n]; 
     
    474483                                                                  if ($name=='agent_data') 
    475484                                                                  { 
    476                                                                         for($o=0;$o<count($this->tree[$z6]['children']);$o++) 
     485                                    $tree_z6_count = count($this->tree[$z6]['children']); 
     486                                                                        for($o=0;$o<$tree_z6_count;++$o) 
    477487                                                                        { 
    478488                                                                          $z7 = $this->tree[$z6]['children'][$o]; 
     
    510520                                } 
    511521                          } elseif($name=='transitions') { 
    512                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     522                $tree_z_count = count($this->tree[$z]['children']); 
     523                                for($j=0;$j<$tree_z_count;++$j) { 
    513524                                  $z2 = $this->tree[$z]['children'][$j]; 
    514525                                  // this is an activity $name = $this->tree[$z2]['name']; 
    515526                                  $aux=Array(); 
    516527                                  if($this->tree[$z2]['name']=='transition') { 
    517                                         for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     528                    $tree_z2_count = count($this->tree[$z2]['children']); 
     529                                        for($k=0;$k<$tree_z2_count;++$k) { 
    518530                                          $z3 = $this->tree[$z2]['children'][$k]; 
    519531                                          $name = trim($this->tree[$z3]['name']); 
     
    527539                                } 
    528540                          } elseif($name=='includes') { 
    529                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     541                $tree_z_count = count($this->tree[$z]['children']); 
     542                                for($j=0;$j<$tree_z_count;++$j) { 
    530543                                  $z2 = $this->tree[$z]['children'][$j]; 
    531544                                  // this is an activity $name = $this->tree[$z2]['name']; 
    532545                                  $aux=Array(); 
    533546                                  if($this->tree[$z2]['name']=='include') { 
    534                                         for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     547                    $tree_z2_count = count($this->tree[$z2]['children']); 
     548                                        for($k=0;$k<$tree_z2_count;++$k) { 
    535549                                          $z3 = $this->tree[$z2]['children'][$k]; 
    536550                                          $name = trim($this->tree[$z3]['name']); 
     
    542556                                } 
    543557                          } elseif($name=='templates') { 
    544                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     558                $tree_z_count = count($this->tree[$z]['children']); 
     559                                for($j=0;$j<$tree_z_count;++$j) { 
    545560                                  $z2 = $this->tree[$z]['children'][$j]; 
    546561                                  // this is an activity $name = $this->tree[$z2]['name']; 
    547562                                  $aux=Array(); 
    548563                                  if($this->tree[$z2]['name']=='template') { 
    549                                         for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     564                    $tree_z2_count = count($this->tree[$z2]['children']); 
     565                                        for($k=0;$k<$tree_z2_count;++$k) { 
    550566                                          $z3 = $this->tree[$z2]['children'][$k]; 
    551567                                          $name = trim($this->tree[$z3]['name']); 
     
    557573                                } 
    558574                          } elseif($name=='resources') { 
    559                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     575                $tree_z_count = count($this->tree[$z]['children']); 
     576                                for($j=0;$j<$tree_z_count;++$j) { 
    560577                                  $z2 = $this->tree[$z]['children'][$j]; 
    561578                                  // this is an activity $name = $this->tree[$z2]['name']; 
    562579                                  $aux=Array(); 
    563580                                  if($this->tree[$z2]['name']=='resource') { 
    564                                         for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     581                    $tree_z2_count = count($this->tree[$z2]['children']); 
     582                                        for($k=0;$k<$tree_z2_count;++$k) { 
    565583                                          $z3 = $this->tree[$z2]['children'][$k]; 
    566584                                          $name = trim($this->tree[$z3]['name']); 
     
    572590                                } 
    573591                          } 
    574                           elseif ($name == 'jobs') 
    575                           { 
    576           for ($j = 0; $j < count($this->tree[$z]['children']); $j++) 
    577           { 
    578             $job = array(); 
    579                                     $jobIndex = $this->tree[$z]['children'][$j]; 
    580             if($this->tree[$jobIndex]['name'] == 'job') 
    581             { 
    582               for ($k = 0; $k < count($this->tree[$jobIndex]['children']); $k++) 
    583               { 
    584                 $propertyIndex = $this->tree[$jobIndex]['children'][$k]; 
    585                 $job[trim($this->tree[$propertyIndex]['name'])] = trim($this->tree[$propertyIndex]['data']); 
    586               } 
    587             } 
    588             $jobs[] = $job; 
    589           } 
     592                          elseif ($name == 'jobs'){ 
     593                  $tree_z_count = count($this->tree[$z]['children']); 
     594                  for ($j = 0; $j < $tree_z_count; ++$j) 
     595                  { 
     596                    $job = array(); 
     597                            $jobIndex = $this->tree[$z]['children'][$j]; 
     598                    if($this->tree[$jobIndex]['name'] == 'job') 
     599                    { 
     600                      $tree_jobIndex_count = count($this->tree[$jobIndex]['children']); 
     601                      for ($k = 0; $k < $tree_jobIndex_count; ++$k) 
     602                      { 
     603                        $propertyIndex = $this->tree[$jobIndex]['children'][$k]; 
     604                        $job[trim($this->tree[$propertyIndex]['name'])] = trim($this->tree[$propertyIndex]['data']); 
     605                      } 
     606                    } 
     607                    $jobs[] = $job; 
     608                  } 
    590609                          } 
    591610                          else { 
  • trunk/workflow/inc/engine/class.ajax_ldap.inc.php

    r3167 r7655  
    155155 
    156156                        $members = array(); 
     157            $security_equals_count = count($security_equals); 
    157158 
    158                         for ($idx=0; $idx<count($security_equals); $idx++) 
     159                        for ($idx=0; $idx<$security_equals_count; ++$idx) 
    159160                        { 
    160161                                $name = $this->id2name((int)$security_equals[$idx]); 
  • trunk/workflow/inc/engine/src/API/Instance.php

    r3167 r7655  
    906906    if(empty($theuser)) $theuser='*'; 
    907907    $found = false; 
    908     for($i=0;$i<count($this->activities);$i++) { 
     908    $activities_count = count($this->activities); 
     909    for($i=0;$i<$activities_count;++$i) { 
    909910      if($this->activities[$i]['wf_activity_id']==$activityId) { 
    910911        // here we are in the good activity 
     
    944945   */ 
    945946  function getActivityUser($activityId) { 
    946     for($i=0;$i<count($this->activities);$i++) { 
     947    $activities_count = count($this->activities); 
     948    for($i=0;$i<$activities_count;++$i) { 
    947949      if($this->activities[$i]['wf_activity_id']==$activityId) { 
    948950        return $this->activities[$i]['wf_user']; 
     
    967969      return false; 
    968970    } 
    969     for($i=0;$i<count($this->activities);$i++)  
     971    $activities_count = count($this->activities); 
     972    for($i=0;$i<$activities_count;++$i) 
    970973    { 
    971974      if($this->activities[$i]['wf_activity_id']==$activityId)  
     
    990993   */ 
    991994  function getActivityStatus($activityId) { 
    992     for($i=0;$i<count($this->activities);$i++) { 
     995    $activities_count = count($this->activities); 
     996    for($i=0;$i<$activities_count;++$i) { 
    993997      if($this->activities[$i]['wf_activity_id']==$activityId) { 
    994998        return $this->activities[$i]['wf_status']; 
     
    10081012  function setActivityStarted($activityId) { 
    10091013    $now = date("U"); 
    1010     for($i=0;$i<count($this->activities);$i++) { 
     1014    $activities_count = count($this->activities); 
     1015    for($i=0;$i<$activities_count;++$i) { 
    10111016      if($this->activities[$i]['wf_activity_id']==$activityId) { 
    10121017        $this->activities[$i]['wf_started']=$now; 
     
    10281033   */ 
    10291034  function getActivityStarted($activityId) { 
    1030     for($i=0;$i<count($this->activities);$i++) { 
     1035    $activities_count = count($this->activities); 
     1036    for($i=0;$i<$activities_count;++$i) { 
    10311037      if($this->activities[$i]['wf_activity_id']==$activityId) { 
    10321038        return $this->activities[$i]['wf_started']; 
     
    10471053  function _get_instance_activity($activityId)  
    10481054  { 
    1049     for($i=0;$i<count($this->activities);$i++) { 
     1055    $activities_count = count($this->activities); 
     1056    for($i=0;$i<$activities_count;$i++) { 
    10501057      if($this->activities[$i]['wf_activity_id']==$activityId) { 
    10511058        return $this->activities[$i]; 
     
    12951302    else  
    12961303    { 
    1297         $max++; 
     1304        ++$max; 
    12981305    } 
    12991306    if($activity_type=='start') 
     
    13781385        $this->unsetNextUser($cand); 
    13791386        $this->sync(); 
    1380         $i++; 
     1387        ++$i; 
    13811388      } 
    13821389      $this->unsetNextUser('*' . $activityId); 
  • trunk/workflow/inc/engine/src/GUI/GUI.php

    r3167 r7655  
    645645    { 
    646646      $result->Move($offset); 
    647       for ($i = 0; $i < $realMaxRecords; $i++) 
     647      for ($i = 0; $i < $realMaxRecords; ++$i) 
    648648      { 
    649649        $res = $result->fetchRow(); 
  • trunk/workflow/inc/engine/src/ProcessManager/ActivityManager.php

    r3167 r7655  
    539539     
    540540    while($this->_list_has_unvisited_nodes($nodes) && !$this->_node_in_list($start_node,$nodes)) { 
    541       for($i=0;$i<count($nodes);$i++) { 
     541      $nodes_count = count($nodes); 
     542      for($i=0;$i<$nodes_count;++$i) { 
    542543        $node=&$nodes[$i]; 
    543544        if(!$node['visited']) { 
  • trunk/workflow/inc/engine/src/ProcessManager/ProcessManager.php

    r5921 r7655  
    299299                $activities=Array(); 
    300300                $transitions=Array(); 
    301                 for($i=0;$i<count($this->tree[1]['children']);$i++) { 
     301        $tree_count = count($this->tree[1]['children']); 
     302                for($i=0;$i<$tree_count;++$i) { 
    302303                        // Process attributes 
    303304                        $z=$this->tree[1]['children'][$i]; 
     
    306307                        //config values 
    307308                        if ($name=='configs') { 
    308                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     309                $tree_z_count = count($this->tree[$z]['children']); 
     310                                for($j=0;$j<$tree_z_count;++$j) { 
    309311                                        $z2 = $this->tree[$z]['children'][$j]; 
    310312                                        // this is a config $name = $this->tree[$z2]['name']; 
    311313                                        $aux = Array(); 
    312314                                        if($this->tree[$z2]['name']=='config') { 
    313                                                 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     315                        $tree_z2_count = count($this->tree[$z2]['children']); 
     316                                                for($k=0;$k<$tree_z2_count;++$k) { 
    314317                                                        $z3 = $this->tree[$z2]['children'][$k]; 
    315318                                                        $name = trim($this->tree[$z3]['name']); 
     
    323326                        //activities 
    324327                        elseif($name=='activities') { 
    325                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     328                $tree_z_count = count($this->tree[$z]['children']); 
     329                                for($j=0;$j<$tree_z_count;++$j) { 
    326330                                        $z2 = $this->tree[$z]['children'][$j]; 
    327331                                        // this is an activity $name = $this->tree[$z2]['name']; 
    328332                                        $aux = Array(); 
    329333                                        if($this->tree[$z2]['name']=='activity') { 
    330                                                 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     334                        $tree_z2_count = count($this->tree[$z2]['children']); 
     335                                                for($k=0;$k<$tree_z2_count;++$k) { 
    331336                                                        $z3 = $this->curre[$z2]['children'][$k]; 
    332337                                                        $name = trim($this->tree[$z3]['name']); 
     
    334339                                                        if($name=='roles') { 
    335340                                                                $roles=Array(); 
    336                                                                 for($l=0;$l<count($this->tree[$z3]['children']);$l++) { 
     341                                $tree_z3_count = count($this->tree[$z3]['children']); 
     342                                                                for($l=0;$l<$tree_z3_count;++$l) { 
    337343                                                                        $z4 = $this->tree[$z3]['children'][$l]; 
    338344                                                                        $name = trim($this->tree[$z4]['name']); 
     
    354360                                                        { 
    355361                                                                $agents=Array(); 
    356                                                                 for($l=0;$l<count($this->tree[$z3]['children']);$l++) 
     362                                $tree_z3_count = count($this->tree[$z3]['children']); 
     363                                                                for($l=0;$l<$tree_z3_count;$l++) 
    357364                                                                { 
    358365                                                                        $z4 = $this->tree[$z3]['children'][$l]; 
     
    362369                                                                        { 
    363370                                                                                $agent = array(); 
    364                                                                                 for($m=0;$m<count($this->tree[$z4]['children']);$m++) 
     371                                        $tree_z4_count = count($this->tree[$z4]['children']); 
     372                                                                                for($m=0;$m<$tree_z4_count;++$m) 
    365373                                                                                { 
    366374                                                                                        $z5 = $this->tree[$z4]['children'][$m]; 
     
    375383                                                                                        elseif ($name=='agent_datas') 
    376384                                                                                        { 
    377                                                                                                 for($n=0;$n<count($this->tree[$z5]['children']);$n++) 
     385                                                $tree_z5_count = count($this->tree[$z5]['children']); 
     386                                                                                                for($n=0;$n<$tree_z5_count;++$n) 
    378387                                                                                                { 
    379388                                                                                                        $z6 = $this->tree[$z5]['children'][$n]; 
     
    383392                                                                                                        if ($name=='agent_data') 
    384393                                                                                                        { 
    385                                                                                                                 for($o=0;$o<count($this->tree[$z6]['children']);$o++) 
     394                                                        $tree_z6_count = count($this->tree[$z6]['children']); 
     395                                                                                                                for($o=0;$o<$tree_z6_count;++$o) 
    386396                                                                                                                { 
    387397                                                                                                                        $z7 = $this->tree[$z6]['children'][$o]; 
     
    419429                                } 
    420430                        } elseif($name=='transitions') { 
    421                                 for($j=0;$j<count($this->tree[$z]['children']);$j++) { 
     431                $tree_z_count = count($this->tree[$z]['children']); 
     432                                for($j=0;$j<$tree_z_count;++$j) { 
    422433                                        $z2 = $this->tree[$z]['children'][$j]; 
    423434                                        // this is an activity $name = $this->tree[$z2]['name']; 
    424435                                        $aux=Array(); 
    425436                                        if($this->tree[$z2]['name']=='transition') { 
    426                                                 for($k=0;$k<count($this->tree[$z2]['children']);$k++) { 
     437                        $tree_z2_count = count($this->tree[$z2]['children']); 
     438                                                for($k=0;$k<$tree_z2_count;++$k) { 
    427439                                                        $z3 = $this->tree[$z2]['children'][$k]; 
    428440                                                        $name = trim($this->tree[$z3]['name']); 
     
    573585                                                        if ($key) 
    574586                                                        { 
    575                                                                 $countfields++; 
     587                                                                ++$countfields; 
    576588                                                                $query .= "$key = ? ,"; 
    577589                                                                $bindvars[] = $value; 
     
    729741                                        if ($key) 
    730742                                        { 
    731                                                 $countfields++; 
     743                                                ++$countfields; 
    732744                                                $query .= "$key = ? ,"; 
    733745                                                $bindvars[] = $value; 
     
    10841096                } else { 
    10851097                        $parts[0]++; 
    1086                         for ($i = 1; $i < count($parts); $i++) { 
     1098            $parts_count = count($parts); 
     1099                        for ($i = 1; $i < $parts_count; ++$i) { 
    10871100                                $parts[$i] = 0; 
    10881101                        } 
  • trunk/workflow/inc/engine/src/common/Base.php

    r3167 r7655  
    331331                        $qe = explode("?", $query); 
    332332                        $query = ''; 
    333                         for ($i = 0; $i < sizeof($qe) - 1; $i++) { 
     333                        for ($i = 0; $i < sizeof($qe) - 1; ++$i) { 
    334334                                $query .= $qe[$i] . ":" . $i; 
    335335                        } 
  • trunk/workflow/inc/fpdf/font/courier.php

    r795 r7655  
    11<?php 
    2 for($i=0;$i<=255;$i++) 
     2for($i=0;$i<=255;++$i) 
    33        $fpdf_charwidths['courier'][chr($i)]=600; 
    44$fpdf_charwidths['courierB']=$fpdf_charwidths['courier']; 
  • trunk/workflow/inc/fpdf/font/makefont/makefont.php

    r5928 r7655  
    2424                } 
    2525        } 
    26         for($i=0;$i<=255;$i++) 
     26        for($i=0;$i<=255;++$i) 
    2727        { 
    2828                if(!isset($cc2gn[$i])) 
     
    118118                        $widths['Delta']=$widths['increment']; 
    119119                //Order widths according to map 
    120                 for($i=0;$i<=255;$i++) 
     120                for($i=0;$i<=255;++$i) 
    121121                { 
    122122                        if(!isset($widths[$map[$i]])) 
     
    189189        $s="array(\n\t"; 
    190190        $cw=$fm['Widths']; 
    191         for($i=0;$i<=255;$i++) 
     191        for($i=0;$i<=255;++$i) 
    192192        { 
    193193                if(chr($i)=="'") 
     
    215215        $s=''; 
    216216        $last=0; 
    217         for($i=32;$i<=255;$i++) 
     217        for($i=32;$i<=255;++$i) 
    218218        { 
    219219                if($map[$i]!=$ref[$i]) 
     
    261261        //Seek OS/2 table 
    262262        $found=false; 
    263         for($i=0;$i<$nb;$i++) 
     263        for($i=0;$i<$nb;++$i) 
    264264        { 
    265265                if(fread($f,4)=='OS/2') 
  • trunk/workflow/inc/fpdf/fpdf.php

    r795 r7655  
    431431        $w=0; 
    432432        $l=strlen($s); 
    433         for($i=0;$i<$l;$i++) 
     433        for($i=0;$i<$l;++$i) 
    434434                $w+=$cw[$s{$i}]; 
    435435        return $w*$this->FontSize/1000; 
     
    486486                $d=0; 
    487487                $nb=count($this->diffs); 
    488                 for($i=1;$i<=$nb;$i++) 
     488                for($i=1;$i<=$nb;++$i) 
    489489                { 
    490490                        if($this->diffs[$i]==$diff) 
     
    750750                        } 
    751751                        $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); 
    752                         $i++; 
     752                        ++$i; 
    753753                        $sep=-1; 
    754754                        $j=$i; 
    755755                        $l=0; 
    756756                        $ns=0; 
    757                         $nl++; 
     757                        ++$nl; 
    758758                        if($border && $nl==2) 
    759759                                $b=$b2; 
     
    764764                        $sep=$i; 
    765765                        $ls=$l; 
    766                         $ns++; 
     766                        ++$ns; 
    767767                } 
    768768                $l+=$cw[$c]; 
     
    773773                        { 
    774774                                if($i==$j) 
    775                                         $i++; 
     775                                        ++$i; 
    776776                                if($this->ws>0) 
    777777                                { 
     
    795795                        $l=0; 
    796796                        $ns=0; 
    797                         $nl++; 
     797                        ++$nl; 
    798798                        if($border && $nl==2) 
    799799                                $b=$b2; 
    800800                } 
    801801                else 
    802                         $i++; 
     802                        ++$i; 
    803803        } 
    804804        //Last chunk 
     
    835835                        //Explicit line break 
    836836                        $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); 
    837                         $i++; 
     837                        ++$i; 
    838838                        $sep=-1; 
    839839                        $j=$i; 
     
    845845                                $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; 
    846846                        } 
    847                         $nl++; 
     847                        ++$nl; 
    848848                        continue; 
    849849                } 
     
    863863                                        $w=$this->w-$this->rMargin-$this->x; 
    864864                                        $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; 
    865                                         $i++; 
    866                                         $nl++; 
     865                                        ++$i; 
     866                                        ++$nl; 
    867867                                        continue; 
    868868                                } 
    869869                                if($i==$j) 
    870                                         $i++; 
     870                                        ++$i; 
    871871                                $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link); 
    872872                        } 
     
    885885                                $wmax=($w-2*$this->cMargin)*1000/$this->FontSize; 
    886886                        } 
    887                         $nl++; 
     887                        ++$nl; 
    888888                } 
    889889                else 
    890                         $i++; 
     890                        ++$i; 
    891891        } 
    892892        //Last chunk 
     
    10891089        { 
    10901090                //Replace number of pages 
    1091                 for($n=1;$n<=$nb;$n++) 
     1091                for($n=1;$n<=$nb;++$n) 
    10921092                        $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]); 
    10931093        } 
     
    11031103        } 
    11041104        $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; 
    1105         for($n=1;$n<=$nb;$n++) 
     1105        for($n=1;$n<=$nb;++$n) 
    11061106        { 
    11071107                //Page 
     
    11451145        $this->_out('<</Type /Pages'); 
    11461146        $kids='/Kids ['; 
    1147         for($i=0;$i<$nb;$i++) 
     1147        for($i=0;$i<$nb;++$i) 
    11481148                $kids.=(3+2*$i).' 0 R '; 
    11491149        $this->_out($kids.']'); 
     
    12451245                        $cw=&$font['cw']; 
    12461246                        $s='['; 
    1247                         for($i=32;$i<=255;$i++) 
     1247                        for($i=32;$i<=255;++$i) 
    12481248                                $s.=$cw[chr($i)].' '; 
    12491249                        $this->_out($s.']'); 
     
    12991299                { 
    13001300                        $trns=''; 
    1301                         for($i=0;$i<count($info['trns']);$i++) 
     1301            $info_count = count($info['trns']); 
     1302                        for($i=0;$i<$info_count;++$i) 
    13021303                                $trns.=$info['trns'][$i].' '.$info['trns'][$i].' '; 
    13031304                        $this->_out('/Mask ['.$trns.']'); 
     
    14201421        $this->_out('0 '.($this->n+1)); 
    14211422        $this->_out('0000000000 65535 f '); 
    1422         for($i=1;$i<=$this->n;$i++) 
     1423        for($i=1;$i<=$this->n;++$i) 
    14231424                $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i])); 
    14241425        //Trailer 
  • trunk/workflow/inc/hook_home.inc.php

    r3167 r7655  
    3434        } 
    3535        $extra_data .=  "<td align=center style='valign:top;width:10em;padding:2px'><a target='_blank' href='".$external["wf_ext_link"]."' nowrap><img width='32px' height='32px' align='center' src='".$external["image"]."'/><br>".$external["name"]."</a></td>"; 
    36         $next_br++; 
     36        ++$next_br; 
    3737        if($next_br == 3){ 
    3838                $extra_data .= "</tr>"; 
  • trunk/workflow/inc/local/classes/class.wf_crypt.php

    r795 r7655  
    6363                $iv = $this->_generate_iv();             
    6464                $out = '';               
    65                 for($c=0;$c < $this->hash_length;$c++) { 
     65                for($c=0;$c < $this->hash_length;++$c) { 
    6666                        $out .= chr(ord($iv[$c]) ^ ord($this->hash_key[$c])); 
    6767                } 
     
    7373                        } 
    7474                        $out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c])); 
    75                         $c++; 
     75                        ++$c; 
    7676                } 
    7777                if($this->base64) $out = base64_encode($out); 
     
    9090                $string = substr($string,$this->hash_length,strlen($string) - $this->hash_length); 
    9191                $iv = $out = ''; 
    92                 for($c=0;$c < $this->hash_length;$c++) { 
     92                for($c=0;$c < $this->hash_length;++$c) { 
    9393                        $iv .= chr(ord($tmp_iv[$c]) ^ ord($this->hash_key[$c])); 
    9494                } 
     
    100100                        } 
    101101                        $out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c])); 
    102                         $c++; 
     102                        ++$c; 
    103103                } 
    104104                return $out; 
  • trunk/workflow/inc/local/classes/class.wf_date.php

    r5921 r7655  
    213213                // Adiciona os anos 
    214214                $years = intval($years); 
    215                 for ($i = 1; $i <= $years; $i++) { 
    216                         $year++; 
     215                for ($i = 1; $i <= $years; ++$i) { 
     216                        ++$year; 
    217217                        $daysInc += ($this->isLeapYear($year)) ? 366 : 365; 
    218218                } 
    219219                // Adiciona os meses de acordo com o número de dias em cada um 
    220220                $months = intval($months); 
    221                 for ($i = 1; $i <= $months; $i++) { 
     221                for ($i = 1; $i <= $months; ++$i) { 
    222222                        $mTemp = $i % 12 - 1; 
    223223                        $yTemp = intval($i / 12); 
    224224                        if (($month + $mTemp) > 12) { 
    225                                 $yTemp++; 
     225                                ++$yTemp; 
    226226                                $mTemp = ($month + $mTemp) - 12; 
    227227                        } else { 
     
    286286                $daysDec = 0; 
    287287                // Adiciona os anos 
    288                 for ($i = 1; $i <= $years; $i++) { 
     288                for ($i = 1; $i <= $years; ++$i) { 
    289289                        $s = ($this->isLeapYear($year)) ? 366 : 365; 
    290290                        $daysDec += ($this->isLeapYear($year)) ? 366 : 365; 
     
    292292                }                
    293293                // Adiciona os meses de acordo com os dias de cada mês 
    294                 for ($i = 1; $i <= $months; $i++) { 
     294                for ($i = 1; $i <= $months; ++$i) { 
    295295                        $mTemp = $i % 12; 
    296296                        $yTemp = intval($i / 12); 
    297297                        if (($month - $mTemp) <= 0) { 
    298                                 $yTemp++; 
     298                                ++$yTemp; 
    299299                                $mTemp = 12 + ($month - $mTemp); 
    300300                        } else { 
     
    611611            if ($year++ == 99) { 
    612612                $year = 0; 
    613                 $century++; 
     613                ++$century; 
    614614            } 
    615615        } 
  • trunk/workflow/inc/local/classes/class.wf_ldap.php

    r3167 r7655  
    142142                /* prepara a saída */ 
    143143                $output = array(); 
    144                 for ($i = 0; $i < $result['count']; $i++) 
     144                for ($i = 0; $i < $result['count']; ++$i) 
    145145                        $output[] = array( 
    146146                                'id' => $result[$i]['uidnumber'][0], 
  • trunk/workflow/inc/local/classes/class.wf_paging.php

    r795 r7655  
    215215        { 
    216216                $output = parent::paginationResult(); 
    217                 if (isset($this->originalRequest['s_co']) && isset($this->originalRequest['s_so'])) 
    218                         for ($i = 0; $i < count($output); $i++) 
     217                if (isset($this->originalRequest['s_co']) && isset($this->originalRequest['s_so'])){ 
     218            $output_count = count($output); 
     219                        for ($i = 0; $i < $output_count; ++$i) 
    219220                                $output[$i]['link'] .= "&amp;s_co=" . $this->storage['s_co'] . "&amp;s_so=" . $this->storage['s_so']; 
     221        } 
    220222                return $output; 
    221223        } 
  • trunk/workflow/inc/local/functions/function.wf_debug.php

    r795 r7655  
    1414        /* prepare the backtrace array */ 
    1515        $importantBacktrace = array(); 
    16         for ($i = 0; $i < count($backTrace); $i++) 
     16    $backTrace_count = count($backTrace); 
     17        for ($i = 0; $i < $backTrace_count; ++$i) 
    1718        { 
    1819                if (strpos($backTrace[$i]['file'], 'class.run_activity.inc.php') !== false) 
  • trunk/workflow/inc/local/functions/function.wf_get_uploaded_files.php

    r795 r7655  
    2525        } 
    2626        else 
    27                 for ($i = 0; $i < $numberOfFiles; $i++) 
     27                for ($i = 0; $i < $numberOfFiles; ++$i) 
    2828                { 
    2929                        foreach ($fileAtributes as $atribute) 
  • trunk/workflow/inc/log/Log.php

    r3167 r7655  
    481481        $class = isset($bt[$depth+1]['class']) ? $bt[$depth+1]['class'] : null; 
    482482        if ($class !== null && strcasecmp($class, 'Log_composite') == 0) { 
    483             $depth++; 
     483            ++$depth; 
    484484            $class = isset($bt[$depth + 1]) ? $bt[$depth + 1]['class'] : null; 
    485485        } 
  • trunk/workflow/inc/log/examples/console.php

    r795 r7655  
    44 
    55$logger = &Log::singleton('console', '', 'ident'); 
    6 for ($i = 0; $i < 10; $i++) { 
     6for ($i = 0; $i < 10; ++$i) { 
    77    $logger->log("Log entry $i"); 
    88} 
  • trunk/workflow/inc/log/examples/display.php

    r795 r7655  
    66              'error_append'  => '</tt></font>'); 
    77$logger = &Log::singleton('display', '', '', $conf, PEAR_LOG_DEBUG); 
    8 for ($i = 0; $i < 10; $i++) { 
     8for ($i = 0; $i < 10; ++$i) { 
    99    $logger->log("Log entry $i"); 
    1010} 
  • trunk/workflow/inc/log/examples/error_log.php

    r795 r7655  
    44 
    55$logger = &Log::singleton('error_log', PEAR_LOG_TYPE_SYSTEM, 'ident'); 
    6 for ($i = 0; $i < 10; $i++) { 
     6for ($i = 0; $i < 10; ++$i) { 
    77    $logger->log("Log entry $i"); 
    88} 
  • trunk/workflow/inc/log/examples/file.php

    r795 r7655  
    55$conf = array('mode' => 0600, 'timeFormat' => '%X %x'); 
    66$logger = &Log::singleton('file', '/tmp/out.log', 'ident', $conf); 
    7 for ($i = 0; $i < 10; $i++) { 
     7for ($i = 0; $i < 10; ++$i) { 
    88    $logger->log("Log entry $i"); 
    99} 
  • trunk/workflow/inc/log/examples/firebug.php

    r795 r7655  
    88                          PEAR_LOG_DEBUG); 
    99 
    10 for ($i = 0; $i < 10; $i++) { 
     10for ($i = 0; $i < 10; ++$i) { 
    1111    $logger->log("Log entry $i"); 
    1212} 
  • trunk/workflow/inc/log/examples/mail.php

    r795 r7655  
    55$conf = array('subject' => 'Important Log Events'); 
    66$logger = &Log::singleton('mail', 'webmaster@example.com', 'ident', $conf); 
    7 for ($i = 0; $i < 10; $i++) { 
     7for ($i = 0; $i < 10; ++$i) { 
    88    $logger->log("Log entry $i"); 
    99} 
  • trunk/workflow/inc/log/examples/null.php

    r795 r7655  
    44 
    55$logger = &Log::singleton('null'); 
    6 for ($i = 0; $i < 10; $i++) { 
     6for ($i = 0; $i < 10; ++$i) { 
    77    $logger->log("Log entry $i"); 
    88} 
  • trunk/workflow/inc/log/examples/sql.php

    r795 r7655  
    55$conf = array('dsn' => 'pgsql://jon@localhost+unix/logs'); 
    66$logger = &Log::singleton('sql', 'log_table', 'ident', $conf); 
    7 for ($i = 0; $i < 10; $i++) { 
     7for ($i = 0; $i < 10; ++$i) { 
    88    $logger->log("Log entry $i"); 
    99} 
  • trunk/workflow/inc/log/examples/syslog.php

    r795 r7655  
    44 
    55$logger = &Log::singleton('syslog', LOG_LOCAL0, 'ident'); 
    6 for ($i = 0; $i < 10; $i++) { 
     6for ($i = 0; $i < 10; ++$i) { 
    77    $logger->log("Log entry $i"); 
    88} 
  • trunk/workflow/inc/log/examples/win.php

    r795 r7655  
    55$conf = array('title' => 'Sample Log Output'); 
    66$logger = &Log::singleton('win', 'LogWindow', 'ident', $conf); 
    7 for ($i = 0; $i < 10; $i++) { 
     7for ($i = 0; $i < 10; ++$i) { 
    88    $logger->log("Log entry $i"); 
    99} 
  • trunk/workflow/inc/nano/JSON.php

    r795 r7655  
    714714                            // found a comment start, and we are in an array, object, or slice 
    715715                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); 
    716                             $c++; 
     716                            ++$c; 
    717717                            //print("Found start of comment at {$c}\n"); 
    718718 
     
    720720                            // found a comment end, and we're in one now 
    721721                            array_pop($stk); 
    722                             $c++; 
     722                            ++$c; 
    723723 
    724724                            for ($i = $top['where']; $i <= $c; ++$i) 
  • trunk/workflow/inc/natural/class.natural.php

    r3167 r7655  
    391391         { 
    392392                //$rows = explode("%NAT_SEP%", wordwrap($this->dataParameter, $lineSize, "%NAT_SEP%")); 
    393                 for ($i=0; $i < strlen($this->dataParameter)/$lineSize; $i++){ 
     393                for ($i=0; $i < strlen($this->dataParameter)/$lineSize; ++$i){ 
    394394                        $rows[] = substr($this->dataParameter, $lineSize*$i , $lineSize); 
    395395                } 
  • trunk/workflow/inc/natural/pos_string.php

    r795 r7655  
    122122                                        } 
    123123                                        $dataS .= $this->mountString($fieldDef['fields'], $value); 
    124                                         $iz++; 
     124                                        ++$iz; 
    125125                                } 
    126126                        } 
     
    178178                                                $data[$fieldName][$iz] = $this->mountResult($fieldDef['fields'], $string, $pt); 
    179179                                        } 
    180                                         $iz++; 
     180                                        ++$iz; 
    181181                                } 
    182182                        } 
  • trunk/workflow/inc/phplot/phplot.php

    r6057 r7655  
    549549            $this->ndx_data_colors[$i] = $this->SetIndexColor($col); 
    550550            $this->ndx_data_dark_colors[$i] = $this->SetIndexDarkColor($col); 
    551             $i++; 
     551            ++$i; 
    552552        } 
    553553 
     
    574574        foreach($this->data_border_colors as $col) { 
    575575            $this->ndx_data_border_colors[$i] = $this->SetIndexColor($col); 
    576             $i++; 
     576            ++$i; 
    577577        } 
    578578    } // function SetDataBorderColors() 
     
    595595        foreach($this->error_bar_colors as $col) { 
    596596            $this->ndx_error_bar_colors[$i] = $this->SetIndexColor($col); 
    597             $i++; 
     597            ++$i; 
    598598        } 
    599599        return TRUE; 
     
    628628                $this->default_dashed_style .= str_repeat('IMG_COLOR_TRANSPARENT,', $s); 
    629629            } 
    630             $t++; 
     630            ++$t; 
    631631        } 
    632632        // Remove trailing comma and add closing parenthesis 
     
    959959 
    960960                $ypos = $which_ypos; 
    961                 for($i = 0; $i < $nlines; $i++) { 
     961                for($i = 0; $i < $nlines; ++$i) { 
    962962                    // Center the text vertically around $which_ypos (each line) 
    963963                    if ($which_valign == 'center') 
     
    983983 
    984984                $xpos = $which_xpos; 
    985                 for($i = 0; $i < $nlines; $i++) { 
     985                for($i = 0; $i < $nlines; ++$i) { 
    986986                    // center the text around $which_xpos 
    987987                    if ($which_halign == 'center') 
     
    17101710 
    17111711        // Fix odd point sizes for point shapes which need it 
    1712         for ($i = 0; $i < $pt; $i++) { 
     1712        for ($i = 0; $i < $pt; ++$i) { 
    17131713            if ($this->point_shapes[$i] == 'diamond' or $this->point_shapes[$i] == 'triangle') { 
    17141714                if ($this->point_sizes[$i] % 2 != 0) { 
     
    17621762        $this->total_records = 0;               // Perform some useful calculations. 
    17631763        $this->records_per_group = 1; 
    1764         for ($i = 0, $recs = 0; $i < $this->num_data_rows; $i++) { 
     1764        for ($i = 0, $recs = 0; $i < $this->num_data_rows; ++$i) { 
    17651765            // Copy 
    17661766            $this->data[$i] = array_values($which_dv[$i]);   // convert to numerical indices. 
     
    18421842 
    18431843        // Process each row of data 
    1844         for ($i=0; $i < $this->num_data_rows; $i++) { 
     1844        for ($i=0; $i < $this->num_data_rows; ++$i) { 
    18451845            $j=0; 
    18461846            // Extract maximum text label length 
     
    18581858                    $miny = $maxy; 
    18591859                } 
    1860                 for (; $j < $this->num_recs[$i]; $j++) { 
     1860                for (; $j < $this->num_recs[$i]; ++$j) { 
    18611861                    $val = (double)$this->data[$i][$j]; 
    18621862                    if ($this->plot_type == 'stackedbars') { 
     
    18761876                $miny = $maxy = (double)$this->data[$i][$j++]; 
    18771877                // $numrecs = @ count($this->data[$i]); 
    1878                 for (; $j < $this->num_recs[$i]; $j++) { 
     1878                for (; $j < $this->num_recs[$i]; ++$j) { 
    18791879                    $val = (double)$this->data[$i][$j]; 
    18801880                    $maxy = ($val > $maxy) ? $val : $maxy; 
     
    31803180            $y_pos += $char_h + $this->line_spacing; 
    31813181 
    3182             $color_index++; 
     3182            ++$color_index; 
    31833183            if ($color_index > $max_color_index) 
    31843184                $color_index = 0; 
     
    32223222        // Get sum of each column? One pie slice per column 
    32233223        if ($this->data_type === 'text-data') { 
    3224             for ($i = 0; $i < $this->num_data_rows; $i++) { 
    3225                 for ($j = 1; $j < $this->num_recs[$i]; $j++) {      // Label ($row[0]) unused in these pie charts 
     3224            for ($i = 0; $i < $this->num_data_rows; ++$i) { 
     3225                for ($j = 1; $j < $this->num_recs[$i]; ++$j) {      // Label ($row[0]) unused in these pie charts 
    32263226                    @ $sumarr[$j] += abs($this->data[$i][$j]);      // NOTE!  sum > 0 to make pie charts 
    32273227                } 
     
    32303230        // Or only one column per row, one pie slice per row? 
    32313231        else if ($this->data_type == 'text-data-single') { 
    3232             for ($i = 0; $i < $this->num_data_rows; $i++) { 
     3232            for ($i = 0; $i < $this->num_data_rows; ++$i) { 
    32333233                $legend[$i] = $this->data[$i][0];                   // Set the legend to column labels 
    32343234                $sumarr[$i] = $this->data[$i][1]; 
     
    32363236        } 
    32373237        else if ($this->data_type == 'data-data') { 
    3238             for ($i = 0; $i < $this->num_data_rows; $i++) { 
    3239                 for ($j = 2; $j < $this->num_recs[$i]; $j++) { 
     3238            for ($i = 0; $i < $this->num_data_rows; ++$i) { 
     3239                for ($j = 2; $j < $this->num_recs[$i]; ++$j) { 
    32403240                    @ $sumarr[$j] += abs($this->data[$i][$j]); 
    32413241                } 
     
    33043304                                    $label_txt, 'center', 'center'); 
    33053305                } 
    3306                 $color_index++; 
     3306                ++$color_index; 
    33073307                $color_index = $color_index % $max_data_colors; 
    33083308            }   // end for 
     
    33253325        $do_labels = ($this->plot_type != 'linepoints'); 
    33263326 
    3327         for($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3327        for($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    33283328            $record = 1;                                // Skip record #0 (title) 
    33293329 
     
    33373337 
    33383338            // Now go for Y, E+, E- 
    3339             for ($idx = 0; $record < $this->num_recs[$row]; $idx++) { 
     3339            for ($idx = 0; $record < $this->num_recs[$row]; ++$idx) { 
    33403340                    // Y: 
    33413341                    $y_now = $this->data[$row][$record++]; 
     
    33673367        $do_labels = ($this->plot_type != 'linepoints'); 
    33683368 
    3369         for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3369        for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    33703370            $rec = 1;                    // Skip record #0 (data label) 
    33713371 
     
    33833383 
    33843384            // Proceed with Y values 
    3385             for($idx = 0;$rec < $this->num_recs[$row]; $rec++, $idx++) { 
     3385            for($idx = 0;$rec < $this->num_recs[$row]; ++$rec, ++$idx) { 
    33863386                if (is_numeric($this->data[$row][$rec])) {              // Allow for missing Y data 
    33873387                    $this->DrawDot($x_now, $this->data[$row][$rec], 
     
    34003400        $this->CheckOption($this->data_type, 'text-data, data-data', __FUNCTION__); 
    34013401 
    3402         for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3402        for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    34033403            $rec = 1;                    // Skip record #0 (data label) 
    34043404 
     
    34163416 
    34173417            // Proceed with Y values 
    3418             for($idx = 0;$rec < $this->num_recs[$row]; $rec++, $idx++) { 
     3418            for($idx = 0;$rec < $this->num_recs[$row]; ++$rec, ++$idx) { 
    34193419                if (is_numeric($this->data[$row][$rec])) {              // Allow for missing Y data 
    34203420                    ImageSetThickness($this->img, $this->line_widths[$idx]); 
     
    35453545        $incomplete_data_defaults_to_x_axis = FALSE;        // TODO: make this configurable 
    35463546 
    3547         for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3547        for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    35483548            $rec = 1;                                       // Skip record #0 (data label) 
    35493549 
     
    35613561            // Proceed with Y values 
    35623562            // Create array of points for imagefilledpolygon() 
    3563             for($idx = 0; $rec < $this->num_recs[$row]; $rec++, $idx++) { 
     3563            for($idx = 0; $rec < $this->num_recs[$row]; ++$rec, ++$idx) { 
    35643564                if (is_numeric($this->data[$row][$rec])) {              // Allow for missing Y data 
    35653565                    $y_now_pixels = $this->ytr($this->data[$row][$rec]); 
     
    35823582 
    35833583        $end = count($posarr); 
    3584         for ($i = 0; $i < $end; $i++) { 
     3584        for ($i = 0; $i < $end; ++$i) { 
    35853585            // Prepend initial points. X = first point's X, Y = x_axis_y_pixels 
    35863586            $x = $posarr[$i][0]; 
     
    36183618        } 
    36193619 
    3620         for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3620        for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    36213621            $record = 1;                                    // Skip record #0 (data label) 
    36223622 
     
    36313631                $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels, $row); 
    36323632 
    3633             for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { 
     3633            for ($idx = 0; $record < $this->num_recs[$row]; ++$record, ++$idx) { 
    36343634                if (($line_style = $this->line_styles[$idx]) == 'none') 
    36353635                    continue; //Allow suppressing entire line, useful with linepoints 
     
    36793679        $start_lines = array_fill(0, $this->records_per_group, FALSE); 
    36803680 
    3681         for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3681        for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    36823682            $record = 1;                                    // Skip record #0 (data label) 
    36833683 
     
    36913691 
    36923692            // Now go for Y, E+, E- 
    3693             for ($idx = 0; $record < $this->num_recs[$row]; $idx++) { 
     3693            for ($idx = 0; $record < $this->num_recs[$row]; ++$idx) { 
    36943694                if (($line_style = $this->line_styles[$idx]) == 'none') 
    36953695                    continue; //Allow suppressing entire line, useful with linepoints 
     
    37493749        } 
    37503750 
    3751         for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { 
     3751        for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 
    37523752            $record = 1;                                    // Skip record #0 (data label) 
    37533753 
     
    37633763 
    37643764            // Draw Lines 
    3765             for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { 
     3765            for ($idx = 0; $record < $this->num_recs[$row]; ++$record, ++$idx) { 
    37663766                if (is_numeric($this->data[$row][$record])) {               // Allow for missing Y data 
    37673767                    $y_now_pixels = $this->ytr($this->data[$row][$record]); 
     
    38133813        $x_first_bar = (($this->records_per_group - 1) * $this->record_bar_width) / 2 - $this->bar_adjust_gap; 
    38143814 
    3815         for ($row = 0; $row < $this->num_data_rows; $row++) { 
     3815        for ($row = 0; $row < $this->num_data_rows; ++$row) { 
    38163816            $record = 1;                                    // Skip record #0 (data label) 
    38173817 
     
    38253825 
    38263826            // Draw the bars in the group: 
    3827             for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { 
     3827            for ($idx = 0; $record < $this->num_recs[$row]; ++$record, ++$idx) { 
    38283828                if (is_numeric($this->data[$row][$record])) {       // Allow for missing Y data 
    38293829                    $x2 = $x1 + $this->actual_bar_width; 
     
    38923892        $x_first_bar = $this->record_bar_width / 2 - $this->bar_adjust_gap; 
    38933893 
    3894         for ($row = 0; $row < $this->num_data_rows; $row++) { 
     3894        for ($row = 0; $row < $this->num_data_rows; ++$row) { 
    38953895            $record = 1;                                    // Skip record #0 (data label) 
    38963896 
     
    39063906            // Draw the bars 
    39073907            $oldv = 0; 
    3908             for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { 
     3908            for ($idx = 0; $record < $this->num_recs[$row]; $record++, ++$idx) { 
    39093909                if (is_numeric($this->data[$row][$record])) {       // Allow for missing Y data 
    39103910 
  • trunk/workflow/inc/phplot/phplot_data.php

    r795 r7655  
    4949        // Put maximum of the maxima in $maxmax 
    5050        $maxmax = 0; 
    51         for($i=0; $i < $this->num_data_rows; $i++) { 
     51        for($i=0; $i < $this->num_data_rows; ++$i) { 
    5252            $rowsize = count($this->data[$i]); 
    53             for ($j=$offset; $j < $rowsize; $j++) { 
     53            for ($j=$offset; $j < $rowsize; ++$j) { 
    5454                if ($this->data[$i][$j] > @ $max[$j]) 
    5555                    $max[$j] = $this->data[$i][$j]; 
     
    6161        // determine amplification factor $amplify 
    6262        $end = count($max) + $offset; 
    63         for ($i=$offset; $i < $end; $i++) { 
     63        for ($i=$offset; $i < $end; ++$i) { 
    6464            if ($max[$i] == 0 || $max[$i] == $maxmax) { 
    6565                $amplify[$i] = 1;  // no divide by zero 
     
    8686        // On my machine, running 1000 iterations over 1000 rows of 12 elements each, 
    8787        // the for loops were 43.2% faster (MBD) 
    88         for ($i = 0; $i < $this->num_data_rows; $i++) { 
     88        for ($i = 0; $i < $this->num_data_rows; ++$i) { 
    8989            $rowsize = count($this->data[$i]); 
    90             for ($j=$offset; $j < $rowsize; $j++) { 
     90            for ($j=$offset; $j < $rowsize; ++$j) { 
    9191                $this->data[$i][$j] *= $amplify[$j]; 
    9292            } 
     
    135135            // Ok. No need to set the offset to skip more records. 
    136136        } elseif ($this->data_type == 'data-data') { 
    137             $off++;             // first Y value at $data[][2] 
     137            ++$off;             // first Y value at $data[][2] 
    138138        } else { 
    139139            $this->DrawError('DoMovingAverage(): wrong data type!!'); 
     
    159159 
    160160        $datarow += $off; 
    161         for ($i = 0; $i < $this->num_data_rows; $i++) { 
     161        for ($i = 0; $i < $this->num_data_rows; ++$i) { 
    162162            $storage[$i % $interval] = @ $this->data[$i][$datarow]; 
    163163            $ma = array_sum($storage); 
     
    180180    { 
    181181        if ($this->data_type == 'text-data') { 
    182             $datarow++; 
     182            ++$datarow; 
    183183        } elseif ($this->data_type != 'data-data') { 
    184184            $this->DrawError('DoWeightedMovingAverage(): wrong data type!!'); 
     
    191191 
    192192        $storage[0] = $this->data[0][$datarow]; 
    193         for ($i=1;$i < $this->num_data_rows; $i++) { 
     193        for ($i=1;$i < $this->num_data_rows; ++$i) { 
    194194            $storage[$i] = @ $storage[$i-1] + $perc * ($this->data[$i][$datarow] - $storage[$i-1]); 
    195195            $ma = array_sum($storage); 
     
    208208        $offset = 1; 
    209209        if ($this->data_type == 'data-data') { 
    210             $offset++; 
     210            ++$offset; 
    211211        } elseif ($this->data_type != 'text-data') { 
    212212            $this->DrawError('wrong data type!!'); 
     
    237237        $offset = 1; 
    238238        if ($this->data_type == 'data-data') { 
    239             $offset++; 
     239            ++$offset; 
    240240        } elseif ($this->data_type != 'text-data') { 
    241241            $this->DrawError('wrong data type!!'); 
  • trunk/workflow/inc/report/downloads.php

    r5307 r7655  
    1616 
    1717$fileDown = ''; 
    18 for($i = 1; $i < (count($pathPartes)); $i++){ 
     18for($i = 1; $i < (count($pathPartes)); ++$i){ 
    1919   $fileDown = ($fileDown != '') ? $fileDown . '/' : $fileDown ; 
    2020   $fileDown .= $pathPartes[$i]; 
  • trunk/workflow/inc/report/includes/classes/FormularioUtil.class.php

    r5307 r7655  
    8888                $resu = pg_query($conn,$sql); 
    8989                if (pg_num_rows($resu)>0) { 
    90                 for ($x=0;$x<pg_num_rows($resu);$x++)  { 
     90                for ($x=0;$x<pg_num_rows($resu);++$x)  { 
    9191                    $arrSelectValues[pg_fetch_result($resu,$x,$id)] = pg_fetch_result($resu,$x,$value); 
    9292                } 
     
    111111                $resu = pg_query($conn,$sql);    
    112112                if (pg_num_rows($resu)>0) { 
    113                 for ($x=0;$x<pg_num_rows($resu);$x++)  { 
     113                for ($x=0;$x<pg_num_rows($resu);++$x)  { 
    114114                    $arrSelectChecks[] = array(pg_fetch_result($resu,$x,$oid), pg_fetch_result($resu,$x,$descricao), false); 
    115115                } 
     
    122122                $resu = pg_query($conn,$sql);    
    123123                if (pg_num_rows($resu)>0) { 
    124                 for ($x=0;$x<pg_num_rows($resu);$x++)  { 
     124                for ($x=0;$x<pg_num_rows($resu);++$x)  { 
    125125                    $arrSelectChecks[] = array(pg_fetch_result($resu,$x,$oid), pg_fetch_result($resu,$x,$descricao), false); 
    126126                } 
  • trunk/workflow/inc/report/includes/classes/Listagem.class.php

    r6413 r7655  
    13881388 
    13891389 
    1390             for ($qtd_reg = 1;$qtd_reg <= $qtd_registros; $qtd_reg++) { 
     1390            for ($qtd_reg = 1;$qtd_reg <= $qtd_registros; ++$qtd_reg) { 
    13911391 
    13921392                if ($this->_isarray) { 
     
    14581458                                                 if ($cntcheckspan) { 
    14591459                                                        if ($this->_temarquivocsv) { 
    1460                                                                 for ($j=1; $j<= $cntcheckspan; $j++) { 
     1460                                                                for ($j=1; $j<= $cntcheckspan; ++$j) { 
    14611461                                                                        if ($j == $cntcheckspan) { 
    14621462                                                                                $this->_txtarquivo .= $txtarquivotexto; 
     
    17291729 
    17301730                                if ($this->_temarquivocsv) { 
    1731                                 for ($j=1; $j<= $cntcheckspan; $j++) { 
     1731                                for ($j=1; $j<= $cntcheckspan; ++$j) { 
    17321732                                        if ($j == $cntcheckspan) { 
    17331733                                                $this->_txtarquivo .= $txtarquivotexto; 
     
    18031803                         if ($cntcheckspan) { 
    18041804                            if ($this->_temarquivocsv) { 
    1805                                 for ($j=1; $j<= $cntcheckspan; $j++) { 
     1805                                for ($j=1; $j<= $cntcheckspan; ++$j) { 
    18061806                                    if ($j == $cntcheckspan) { 
    18071807                                        $this->_txtarquivo .= $txtarquivotexto; 
     
    21582158    public function autoAdicionarColunas() { 
    21592159        $i = pg_num_fields($this->dados); 
    2160         for ($j = 0; $j < $i; $j++) { 
     2160        for ($j = 0; $j < $i; ++$j) { 
    21612161            $fieldname = pg_field_name($this->dados, $j); 
    21622162            $tipo = pg_field_type($this->dados, $j); 
  • trunk/workflow/inc/report/includes/classes/SqlParser.class.php

    r5307 r7655  
    118118    protected function getQuantidadeIfs($texto) { 
    119119        $qtd = 0; 
    120         for ($i = 0;  $i <= strlen($texto); $i++) { 
     120        for ($i = 0;  $i <= strlen($texto); ++$i) { 
    121121            if (strtolower(substr($texto,$i,3)) == "#if") { 
    122122                $qtd = $qtd + 1; 
     
    128128    protected function numerarCondicao($texto,$num) { 
    129129        $qtd = 0; 
    130         for ($i = 0;  $i <= strlen($texto); $i++) { 
     130        for ($i = 0;  $i <= strlen($texto); ++$i) { 
    131131            if (strtolower(substr($texto,$i,3)) == "#if") { 
    132132                $qtd = $qtd + 1; 
     
    134134                $condicoesfechadas = 0; 
    135135                if ($qtd == $num) { 
    136                     for ($j = $i+1;  $j <= strlen($texto); $j++) { 
     136                    for ($j = $i+1;  $j <= strlen($texto); ++$j) { 
    137137                         
    138138                        if ((strtolower(substr($texto,$j,5)) == "#/if#")) { 
  • trunk/workflow/inc/report/xajax/xajax.inc.php

    r5307 r7655  
    608608                if ($bFoundFunction) 
    609609                { 
    610                         for ($i = 0; $i < sizeof($aArgs); $i++) 
     610                        for ($i = 0; $i < sizeof($aArgs); ++$i) 
    611611                        { 
    612612                                // If magic quotes is on, then we need to strip the slashes from the args 
  • trunk/workflow/inc/report/xajax/xajaxCompress.php

    r5307 r7655  
    5858        $escaped = false; 
    5959        $quoteChar = ""; 
    60          
    61         for($i=0;$i<count($lines);$i++) 
     60    $lines_count = count($lines); 
     61 
     62        for($i=0;$i<$lines_count;++$i) 
    6263        { 
    6364                $line = $lines[$i]; 
     
    6566         
    6667                //loop through line's characters and take out any literal strings, replace them with ___i___ where i is the index of this string 
    67                 for($j=0;$j<strlen($line);$j++) 
     68                for($j=0;$j<strlen($line);++$j) 
    6869                { 
    6970                        $c = substr($line,$j,1); 
     
    8990                                        $quoteChar = $d; 
    9091                                        $literal = $d;   
    91                                         $j++;    
     92                                        ++$j; 
    9293                                } 
    9394                                else if($d=="//") //ignore string markers that are found inside comments 
     
    126127                                        array_push($literal_strings,$literal); 
    127128         
    128                                         $j++; 
     129                                        ++$j; 
    129130                                } 
    130131                                else if($c == "\\" && !$escaped) 
     
    143144         
    144145        //now process each line at a time 
    145         for($i=0;$i<count($lines);$i++) 
     146    $lines_count = count($lines); 
     147        for($i=0;$i<$lines_count;++$i) 
    146148        { 
    147149                $line = $lines[$i]; 
     
    175177         
    176178        //finally loop through and replace all the literal strings: 
    177         for($i=0;$i<count($literal_strings);$i++) 
     179    $literal_strings_count = count($literal_strings); 
     180        for($i=0;$i<$literal_strings_count;++$i) 
    178181                $sJS = str_replace("___".$i."___",$literal_strings[$i],$sJS); 
    179182         
  • trunk/workflow/inc/report/xajax/xajaxResponse.inc.php

    r5307 r7655  
    257257                if ($queryStart !== FALSE) 
    258258                { 
    259                         $queryStart++; 
     259                        ++$queryStart; 
    260260                        $queryEnd = strpos($sURL, '#', $queryStart); 
    261261                        if ($queryEnd === FALSE) 
  • trunk/workflow/inc/smarty/Config_File.class.php

    r795 r7655  
    282282        preg_match_all('!^.*\r?\n?!m', $contents, $match); 
    283283        $lines = $match[0]; 
    284         for ($i=0, $count=count($lines); $i<$count; $i++) { 
     284        for ($i=0, $count=count($lines); $i<$count; ++$i) { 
    285285            $line = $lines[$i]; 
    286286            if (empty($line)) continue; 
  • trunk/workflow/inc/smarty/Smarty_Compiler.class.php

    r795 r7655  
    277277 
    278278        /* loop through text blocks */ 
    279         for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) { 
     279        for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; ++$curr_tb) { 
    280280            /* match anything resembling php tags */ 
    281281            if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?\s*php\s*[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) { 
     
    283283                $sp_match[1] = array_unique($sp_match[1]); 
    284284                usort($sp_match[1], '_smarty_sort_length'); 
    285                 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) { 
     285                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) { 
    286286                    $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]); 
    287287                } 
    288288                /* process each one */ 
    289                 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) { 
     289                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) { 
    290290                    if ($this->php_handling == SMARTY_PHP_PASSTHRU) { 
    291291                        /* echo php contents */ 
     
    308308        /* Compile the template tags into PHP code. */ 
    309309        $compiled_tags = array(); 
    310         for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) { 
     310        for ($i = 0, $for_max = count($template_tags); $i < $for_max; ++$i) { 
    311311            $this->_current_line_no += substr_count($text_blocks[$i], "\n"); 
    312312            $compiled_tags[] = $this->_compile_tag($template_tags[$i]); 
     
    331331            if ($strip) { 
    332332                /* strip all $text_blocks before the next '/strip' */ 
    333                 for ($j = $i + 1; $j < $for_max; $j++) { 
     333                for ($j = $i + 1; $j < $for_max; ++$j) { 
    334334                    /* remove leading and trailing whitespaces of each line */ 
    335335                    $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]); 
     
    354354         
    355355        /* Interleave the compiled contents and text blocks to get the final result. */ 
    356         for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) { 
     356        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; ++$i) { 
    357357            if ($compiled_tags[$i] == '') { 
    358358                // tag result empty, remove first newline from following text block 
     
    12791279 
    12801280        $is_arg_stack = array(); 
    1281  
    1282         for ($i = 0; $i < count($tokens); $i++) { 
     1281        $tokens_count = count($tokens); 
     1282         
     1283        for ($i = 0; $i < $tokens_count; ++$i) { 
    12831284 
    12841285            $token = &$tokens[$i]; 
     
    14701471            case 'even': 
    14711472                if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { 
    1472                     $expr_end++; 
     1473                    ++$expr_end; 
    14731474                    $expr_arg = $tokens[$expr_end++]; 
    14741475                    $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; 
     
    14791480            case 'odd': 
    14801481                if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { 
    1481                     $expr_end++; 
     1482                    ++$expr_end; 
    14821483                    $expr_arg = $tokens[$expr_end++]; 
    14831484                    $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; 
     
    14881489            case 'div': 
    14891490                if (@$tokens[$expr_end] == 'by') { 
    1490                     $expr_end++; 
     1491                    ++$expr_end; 
    14911492                    $expr_arg = $tokens[$expr_end++]; 
    14921493                    $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")"; 
     
    18431844        $this->_parse_vars_props($match); 
    18441845        $replace = array(); 
    1845         for ($i = 0, $count = count($match); $i < $count; $i++) { 
     1846        for ($i = 0, $count = count($match); $i < $count; ++$i) { 
    18461847            $replace[$orig_vals[$i]] = $match[$i]; 
    18471848        } 
     
    19051906        list(, $_modifiers, $modifier_arg_strings) = $_match; 
    19061907 
    1907         for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) { 
     1908        for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; ++$_i) { 
    19081909            $_modifier_name = $_modifiers[$_i]; 
    19091910 
  • trunk/workflow/inc/smarty/internals/core.process_cached_inserts.php

    r795 r7655  
    1818    list($cached_inserts, $insert_args) = $match; 
    1919 
    20     for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { 
     20    for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; ++$i) { 
    2121        if ($smarty->debugging) { 
    2222            $_params = array(); 
  • trunk/workflow/inc/smarty/internals/core.write_cache_file.php

    r795 r7655  
    4444        $level = 0; 
    4545        $j = 0; 
    46         for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) { 
     46        for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; ++$i) { 
    4747            if ($results[$i] == $match[0][$j]) { 
    4848                // nocache tag 
     
    5353                    if ($level++ > 0) unset($results[$i]); 
    5454                } 
    55                 $j++; 
     55                ++$j; 
    5656            } elseif ($level > 0) { 
    5757                unset($results[$i]); 
  • trunk/workflow/inc/smarty/internals/core.write_compiled_include.php

    r795 r7655  
    3838 
    3939    $this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this'; 
    40     for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) { 
     40    for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; ++$_i) { 
    4141        $_match =& $_match_source[$_i]; 
    4242        $source = $_match[4]; 
     
    5757            } 
    5858 
    59             for ($i=0, $count = count($tokens); $i < $count; $i++) { 
     59            for ($i=0, $count = count($tokens); $i < $count; ++$i) { 
    6060                if (is_array($tokens[$i])) { 
    6161                    if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') { 
  • trunk/workflow/inc/smarty/plugins/block.textformat.php

    r795 r7655  
    7676    $_output = ''; 
    7777 
    78     for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) { 
     78    for($_x = 0, $_y = count($_paragraphs); $_x < $_y; ++$_x) { 
    7979        if ($_paragraphs[$_x] == '') { 
    8080            continue; 
  • trunk/workflow/inc/smarty/plugins/function.config_load.php

    r795 r7655  
    121121                $smarty->_config[1]['files'][$_file] = true; 
    122122        } else if ($_scope == 'global') { 
    123             for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) { 
     123            for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; ++$i) { 
    124124                $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars); 
    125125                $smarty->_config[$i]['files'][$_file] = true; 
  • trunk/workflow/inc/smarty/plugins/function.html_select_date.php

    r795 r7655  
    181181    $field_separator_count = -1; 
    182182    if ($display_months) { 
    183         $field_separator_count++; 
     183        ++$field_separator_count; 
    184184        $month_names = array(); 
    185185        $month_values = array(); 
     
    188188            $month_values[''] = ''; 
    189189        } 
    190         for ($i = 1; $i <= 12; $i++) { 
     190        for ($i = 1; $i <= 12; ++$i) { 
    191191            $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)); 
    192192            $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000)); 
     
    225225            $day_values[''] = ''; 
    226226        } 
    227         for ($i = 1; $i <= 31; $i++) { 
     227        for ($i = 1; $i <= 31; ++$i) { 
    228228            $days[] = sprintf($day_format, $i); 
    229229            $day_values[] = sprintf($day_value_format, $i); 
     
    255255 
    256256    if ($display_years) { 
    257         $field_separator_count++; 
     257        ++$field_separator_count; 
    258258        if (null !== $field_array){ 
    259259            $year_name = $field_array . '[' . $prefix . 'Year]'; 
     
    303303 
    304304    // Loop thru the field_order field 
    305     for ($i = 0; $i <= 2; $i++){ 
     305    for ($i = 0; $i <= 2; ++$i){ 
    306306        $c = substr($field_order, $i, 1); 
    307307        switch ($c){ 
  • trunk/workflow/inc/smarty/plugins/function.html_select_time.php

    r795 r7655  
    8585        $hours       = $use_24_hours ? range(0, 23) : range(1, 12); 
    8686        $hour_fmt = $use_24_hours ? '%H' : '%I'; 
    87         for ($i = 0, $for_max = count($hours); $i < $for_max; $i++) 
     87        for ($i = 0, $for_max = count($hours); $i < $for_max; ++$i) 
    8888            $hours[$i] = sprintf('%02d', $hours[$i]); 
    8989        $html_result .= '<select name='; 
  • trunk/workflow/inc/smarty/plugins/function.html_table.php

    r795 r7655  
    128128        $output .= "<thead><tr>\n"; 
    129129 
    130         for ($r=0; $r<$cols_count; $r++) { 
     130        for ($r=0; $r<$cols_count; ++$r) { 
    131131            $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>'; 
    132132            $output .= $cols[$r]; 
     
    137137 
    138138    $output .= "<tbody>\n"; 
    139     for ($r=0; $r<$rows; $r++) { 
     139    for ($r=0; $r<$rows; ++$r) { 
    140140        $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n"; 
    141141        $rx =  ($vdir == 'down') ? $r*$cols_count : ($rows-1-$r)*$cols_count; 
    142142 
    143         for ($c=0; $c<$cols_count; $c++) { 
     143        for ($c=0; $c<$cols_count; ++$c) { 
    144144            $x =  ($hdir == 'right') ? $rx+$c : $rx+$cols_count-1-$c; 
    145145            if ($inner!='cols') { 
  • trunk/workflow/inc/smarty/plugins/function.mailto.php

    r795 r7655  
    8989 
    9090    $mail_parm_vals = ''; 
    91     for ($i=0; $i<count($mail_parms); $i++) { 
     91    $mail_parms_count = count($mail_parms); 
     92    for ($i=0; $i<$mail_parms_count; ++$i) { 
    9293        $mail_parm_vals .= (0==$i) ? '?' : '&'; 
    9394        $mail_parm_vals .= $mail_parms[$i]; 
     
    105106 
    106107        $js_encode = ''; 
    107         for ($x=0; $x < strlen($string); $x++) { 
     108        for ($x=0; $x < strlen($string); ++$x) { 
    108109            $js_encode .= '%' . bin2hex($string[$x]); 
    109110        } 
     
    114115        $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>'; 
    115116 
    116         for($x = 0, $y = strlen($string); $x < $y; $x++ ) { 
     117        for($x = 0, $y = strlen($string); $x < $y; ++$x ) { 
    117118            $ord[] = ord($string[$x]);    
    118119        } 
     
    138139        } 
    139140        $address_encode = ''; 
    140         for ($x=0; $x < strlen($address); $x++) { 
     141        for ($x=0; $x < strlen($address); ++$x) { 
    141142            if(preg_match('!\w!',$address[$x])) { 
    142143                $address_encode .= '%' . bin2hex($address[$x]); 
     
    146147        } 
    147148        $text_encode = ''; 
    148         for ($x=0; $x < strlen($text); $x++) { 
     149        for ($x=0; $x < strlen($text); ++$x) { 
    149150            $text_encode .= '&#x' . bin2hex($text[$x]).';'; 
    150151        } 
  • trunk/workflow/inc/smarty/plugins/modifier.escape.php

    r795 r7655  
    4242            // escape every character into hex 
    4343            $return = ''; 
    44             for ($x=0; $x < strlen($string); $x++) { 
     44            for ($x=0; $x < strlen($string); ++$x) { 
    4545                $return .= '%' . bin2hex($string[$x]); 
    4646            } 
     
    4949        case 'hexentity': 
    5050            $return = ''; 
    51             for ($x=0; $x < strlen($string); $x++) { 
     51            for ($x=0; $x < strlen($string); ++$x) { 
    5252                $return .= '&#x' . bin2hex($string[$x]) . ';'; 
    5353            } 
     
    5656        case 'decentity': 
    5757            $return = ''; 
    58             for ($x=0; $x < strlen($string); $x++) { 
     58            for ($x=0; $x < strlen($string); ++$x) { 
    5959                $return .= '&#' . ord($string[$x]) . ';'; 
    6060            } 
     
    7272           // escape non-standard chars, such as ms document quotes 
    7373           $_res = ''; 
    74            for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) { 
     74           for($_i = 0, $_len = strlen($string); $_i < $_len; ++$_i) { 
    7575               $_ord = ord(substr($string, $_i, 1)); 
    7676               // non-standard char, escape it 
  • trunk/workflow/inc/smarty/plugins/outputfilter.trimwhitespace.php

    r795 r7655  
    6565    $_len = strlen($search_str); 
    6666    $_pos = 0; 
    67     for ($_i=0, $_count=count($replace); $_i<$_count; $_i++) 
     67    for ($_i=0, $_count=count($replace); $_i<$_count; ++$_i) 
    6868        if (($_pos=strpos($subject, $search_str, $_pos))!==false) 
    6969            $subject = substr_replace($subject, $replace[$_i], $_pos, $_len); 
Note: See TracChangeset for help on using the changeset viewer.