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/inc/smarty/plugins
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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.