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

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

Location:
trunk/workflow/inc/report
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.