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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.bocalendar.inc.php

    r7436 r7655  
    912912                                $endtime += $offset*$multi; 
    913913                                $starttime <= $enddate; 
    914                                 $i++, 
     914                                ++$i, 
    915915                                $i = ($i < count($dowOffsets))?$i:0, 
    916916                                $multi = $dowOffsets[$i], 
     
    12521252                                        $minparts = min($l_participants); 
    12531253                                        $part = Array(); 
    1254                                         for($i=0;$i<count($parts);$i++) 
     1254                                        for($i=0;$i<count($parts);++$i) 
    12551255                                        { 
    12561256                                                if (($accept_type = substr($parts[$i],-1,1)) == '0' || (int)$accept_type > 0) 
     
    21372137                        { 
    21382138                                $exceptions = explode(',',$exception_str); 
    2139                                 for($exception_count=0;$exception_count<count($exceptions);$exception_count++) 
     2139                                for($exception_count=0;$exception_count<count($exceptions);++$exception_count) 
    21402140                                { 
    21412141                                        $exception[] = (int)$exceptions[$exception_count]; 
     
    21962196                                } 
    21972197 
    2198                                 for($i=0;$i<count($this->cached_events[$date]);$i++) 
     2198                                for($i=0;$i<count($this->cached_events[$date]);++$i) 
    21992199                                { 
    22002200                                        if($this->cached_events[$date][$i]['id'] == $event['id'] || $this->cached_events[$date][$i]['reference'] == $event['id']) 
     
    22562256                        $repeated = $this->repeating_events; 
    22572257                        $r_events = count($repeated); 
    2258                         for ($i=0;$i<$r_events;$i++) 
     2258                        for ($i=0;$i<$r_events;++$i) 
    22592259                        { 
    22602260                                $rep_events = $this->repeating_events[$i]; 
     
    24602460                                        { 
    24612461                                                $emonth = 1; 
    2462                                                 $eyear++; 
     2462                                                ++$eyear; 
    24632463                                        } 
    24642464                                } 
     
    25102510                        if($c_cached_ids) 
    25112511                        { 
    2512                                 for($i=0;$i<$c_cached_ids;$i++) 
     2512                                for($i=0;$i<$c_cached_ids;++$i) 
    25132513                                { 
    25142514                                        $event = $this->so->read_entry($cached_event_ids[$i]); 
     
    25252525                                                $start['month'] = (int)(substr($startdate,4,2)); 
    25262526                                                $start['mday'] = (int)(substr($startdate,6,2)); 
    2527                                                 for($j=$startdate,$k=0;$j<=$enddate;$k++,$j=(int)(date('Ymd',mktime(0,0,0,$start['month'],$start['mday'] + $k,$start['year'])))) 
     2527                                                for($j=$startdate,$k=0;$j<=$enddate;++$k,$j=(int)(date('Ymd',mktime(0,0,0,$start['month'],$start['mday'] + $k,$start['year'])))) 
    25282528                                                { 
    25292529                                                        $c_evt_day = count($this->cached_events[$j]) - 1; 
     
    25562556                        if($c_cached_ids_repeating) 
    25572557                        { 
    2558                                 for($i=0;$i<$c_cached_ids_repeating;$i++) 
     2558                                for($i=0;$i<$c_cached_ids_repeating;++$i) 
    25592559                                { 
    25602560                                        $this->repeating_events[$i] = $this->so->read_entry($cached_event_ids_repeating[$i]); 
     
    25752575                                        { 
    25762576                                                echo '<!-- Total events found matching '.$search_date.' = '.count($this->cached_events[$search_date]).' -->'."\n"; 
    2577                                                 for($i=0;$i<count($this->cached_events[$search_date]);$i++) 
     2577                                                for($i=0;$i<count($this->cached_events[$search_date]);++$i) 
    25782578                                                { 
    25792579                                                        echo '<!-- Date: '.$search_date.' ['.$i.'] = '.$this->cached_events[$search_date][$i]['id'].' -->'."\n"; 
     
    25832583                        } 
    25842584                        $retval = Array(); 
    2585                         for($j=date('Ymd',mktime(0,0,0,$smonth,$sday,$syear)),$k=0;$j<=date('Ymd',mktime(0,0,0,$emonth,$eday,$eyear));$k++,$j=date('Ymd',mktime(0,0,0,$smonth,$sday + $k,$syear))) 
     2585                        for($j=date('Ymd',mktime(0,0,0,$smonth,$sday,$syear)),$k=0;$j<=date('Ymd',mktime(0,0,0,$emonth,$eday,$eyear));++$k,$j=date('Ymd',mktime(0,0,0,$smonth,$sday + $k,$syear))) 
    25862586                        { 
    25872587                                if(is_array($this->cached_events[$j])) 
     
    27652765                function prepare_matrix($interval,$increment,$part,$fulldate) 
    27662766                { 
    2767                         for($h=0;$h<24;$h++) 
    2768                         { 
    2769                                 for($m=0;$m<$interval;$m++) 
     2767                        for($h=0;$h<24;++$h) 
     2768                        { 
     2769                                for($m=0;$m<$interval;++$m) 
    27702770                                { 
    27712771                                        $index = (($h * 10000) + (($m * $increment) * 100)); 
     
    27852785                                $starttemp = $this->splittime("$start",False); 
    27862786                                $subminute = 0; 
    2787                                 for($m=0;$m<$interval;$m++) 
     2787                                for($m=0;$m<$interval;++$m) 
    27882788                                { 
    27892789                                        $minutes = $increment * $m; 
     
    27972797                                $endtemp = $this->splittime("$end",False); 
    27982798                                $addminute = 0; 
    2799                                 for($m=0;$m<$interval;$m++) 
     2799                                for($m=0;$m<$interval;++$m) 
    28002800                                { 
    28012801                                        $minutes = ($increment * $m); 
     
    28092809                                $endtemp = $this->splittime("$end",False); 
    28102810 
    2811                                 for($h=$starttemp['hour'];$h<=$endtemp['hour'];$h++) 
     2811                                for($h=$starttemp['hour'];$h<=$endtemp['hour'];++$h) 
    28122812                                { 
    28132813                                        $startminute = 0; 
     
    28252825                                        $time_display = $GLOBALS['phpgw']->common->show_date($eventstart['raw'],$this->users_timeformat).'-'.$GLOBALS['phpgw']->common->show_date($eventend['raw'],$this->users_timeformat); 
    28262826                                        $time_description = '('.$time_display.') '.$this->get_short_field($event,$private,'title').$this->display_status($event['participants'][$part]); 
    2827                                         for($m=$startminute;$m<$endminute;$m++) 
     2827                                        for($m=$startminute;$m<$endminute;++$m) 
    28282828                                        { 
    28292829                                                $index = ($hour + (($m * $increment) * 100)); 
     
    28662866 
    28672867                        //verifica se todos os participantes rejeitaram o evento 
    2868                         for($i = 0; $i < count($sts); $i++ ){  
     2868                        for($i = 0; $i < count($sts); ++$i ){ 
    28692869                                if( $sts[i] === "R") 
    28702870                                        unset( $sts[i] ); 
     
    30653065                    $last_space = false; 
    30663066 
    3067                     for($i=0, $count=0; $i < $str_width; $i++, $count++) 
     3067                    for($i=0, $count=0; $i < $str_width; ++$i, ++$count) 
    30683068                    { 
    30693069                        // If we're at a break 
     
    41994199                { 
    42004200                        $already_moved = Array(); 
    4201                         for($v=$firstday;$v<=$lastday;$v++) 
     4201                        for($v=$firstday;$v<=$lastday;++$v) 
    42024202                        { 
    42034203                                if (!$this->cached_events[$v]) 
     
    44364436                        { 
    44374437                                $cal_grps = ''; 
    4438                                 for($i=0;$i<count($event['groups']);$i++) 
     4438                                for($i=0;$i<count($event['groups']);++$i) 
    44394439                                { 
    44404440                                        if($GLOBALS['phpgw']->accounts->exists($event['groups'][$i])) 
Note: See TracChangeset for help on using the changeset viewer.