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/prototype/plugins/icalcreator/iCalcreator.class.php

    r5399 r7655  
    393393            if( $propix != $xpropno ) 
    394394              $reduced[$xpropkey] = $xpropvalue; 
    395             $xpropno++; 
     395            ++$xpropno; 
    396396          } 
    397397        } 
     
    506506                                    : array( $xpropkey, $this->xprop[$xpropkey]['value'] ); 
    507507            else 
    508               $xpropno++; 
     508              ++$xpropno; 
    509509          } 
    510510          unset( $this->propix[$propName] ); 
     
    829829          return TRUE; 
    830830        } 
    831         $cix1dC++; 
     831        ++$cix1dC; 
    832832      } 
    833833      elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { 
     
    891891        if( $index == $cix1gC ) 
    892892          return $component->copy(); 
    893         $cix1gC++; 
     893        ++$cix1gC; 
    894894      } 
    895895      elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] ) 
     
    944944          if( $index == $cix1gC ) 
    945945            return $component->copy(); 
    946           $cix1gC++; 
     946          ++$cix1gC; 
    947947        } 
    948948      } // end elseif( is_array( $arg1 )) { // array( *[propertyName => propertyValue] ) 
     
    950950        if( $index == $cix1gC ) 
    951951          return $component->copy(); 
    952         $cix1gC++; 
     952        ++$cix1gC; 
    953953      } 
    954954    } // end foreach ( $this->components.. . 
     
    14361436          return TRUE; 
    14371437        } 
    1438         $cix1sC++; 
     1438        ++$cix1sC; 
    14391439      } 
    14401440      elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) { // UID insert/replace 
     
    15231523    elseif( 'vtimezone' == $b->objName )          return  1; 
    15241524    $sortkeys = array( 'year', 'month', 'day', 'hour', 'min', 'sec' ); 
    1525     for( $k = 0; $k < 4 ; $k++ ) { 
     1525    for( $k = 0; $k < 4 ; ++$k ) { 
    15261526      if(        empty( $a->srtk[$k] ))           return -1; 
    15271527      elseif(    empty( $b->srtk[$k] ))           return  1; 
     
    16071607        continue; 
    16081608      if(     'BEGIN:VCALENDAR' == strtoupper( substr( $line, 0, 15 ))) { 
    1609         $calsync++; 
     1609        ++$calsync; 
    16101610        continue; 
    16111611      } 
     
    16531653        if( $newProp ) { 
    16541654          $newProp = FALSE; 
    1655           $lastix++; 
     1655          ++$lastix; 
    16561656          $proprows[$lastix]  = $line; 
    16571657        } 
     
    16661666            /* get property name */ 
    16671667        $cix = $propname = null; 
    1668         for( $cix=0, $clen = strlen( $line ); $cix < $clen; $cix++ ) { 
     1668        for( $cix=0, $clen = strlen( $line ); $cix < $clen; ++$cix ) { 
    16691669          if( in_array( $line[$cix], array( ':', ';' ))) 
    16701670            break; 
     
    16801680        $attrix = -1; 
    16811681        $strlen = strlen( $line ); 
    1682         for( $cix=0; $cix < $strlen; $cix++ ) { 
     1682        for( $cix=0; $cix < $strlen; ++$cix ) { 
    16831683          if((       ':'   == $line[$cix] )             && 
    16841684                   ( '://' != substr( $line, $cix, 3 )) && 
     
    17201720          $content  = explode( ',', $line ); 
    17211721          $clen     = count( $content ); 
    1722           for( $cix = 0; $cix < $clen; $cix++ ) { 
     1722          for( $cix = 0; $cix < $clen; ++$cix ) { 
    17231723            if( "\\" == substr( $content[$cix], -1 )) { 
    17241724              $content[$cix] .= ','.$content[$cix + 1]; 
    17251725              unset( $content[$cix + 1] ); 
    1726               $cix++; 
    1727             } 
     1726              ++$cix;            } 
    17281727          } 
    17291728          if( 1 < count( $content )) { 
     
    29842983        if( $fno < $cnt ) 
    29852984          $content .= ','; 
    2986         $fno++; 
     2985        ++$fno; 
    29872986      } 
    29882987      $output .= $this->_createElement( 'FREEBUSY', $attributes, $content ); 
     
    33683367        if( $rno < $cnt ) 
    33693368          $content .= ','; 
    3370         $rno++; 
     3369        ++$rno; 
    33713370      } 
    33723371      $output    .= $this->_createElement( 'RDATE', $attributes, $content ); 
     
    45934592                } 
    45944593                $content2 .= $content21.$content22; 
    4595                 $bydaycnt++; 
     4594                ++$bydaycnt; 
    45964595              } 
    45974596              else { 
     
    46014600                else { 
    46024601                  $content22 .= $valuePart; 
    4603                   $bydaycnt++; 
     4602                  ++$bydaycnt; 
    46044603                } 
    46054604                $content2 .= $content21.$content22; 
     
    50775076            if( $propix != $xpropno ) 
    50785077              $reduced[$xpropkey] = $xpropvalue; 
    5079             $xpropno++; 
     5078            ++$xpropno; 
    50805079          } 
    50815080        } 
     
    51395138        $ak = ( is_array( $this->attach )) ? array_keys( $this->attach ) : array(); 
    51405139        while( is_array( $this->attach ) && !isset( $this->attach[$propix] ) && ( 0 < count( $this->attach )) && ( $propix < end( $ak ))) 
    5141           $propix++; 
     5140          ++$propix; 
    51425141        if( !isset( $this->attach[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    51435142        return ( $inclParam ) ? $this->attach[$propix] : $this->attach[$propix]['value']; 
     
    51465145        $ak = ( is_array( $this->attendee )) ? array_keys( $this->attendee ) : array(); 
    51475146        while( is_array( $this->attendee ) && !isset( $this->attendee[$propix] ) && ( 0 < count( $this->attendee )) && ( $propix < end( $ak ))) 
    5148           $propix++; 
     5147          ++$propix; 
    51495148        if( !isset( $this->attendee[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    51505149        return ( $inclParam ) ? $this->attendee[$propix] : $this->attendee[$propix]['value']; 
     
    51535152        $ak = ( is_array( $this->categories )) ? array_keys( $this->categories ) : array(); 
    51545153        while( is_array( $this->categories ) && !isset( $this->categories[$propix] ) && ( 0 < count( $this->categories )) && ( $propix < end( $ak ))) 
    5155           $propix++; 
     5154          ++$propix; 
    51565155        if( !isset( $this->categories[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    51575156        return ( $inclParam ) ? $this->categories[$propix] : $this->categories[$propix]['value']; 
     
    51635162        $ak = ( is_array( $this->comment )) ? array_keys( $this->comment ) : array(); 
    51645163        while( is_array( $this->comment ) && !isset( $this->comment[$propix] ) && ( 0 < count( $this->comment )) && ( $propix < end( $ak ))) 
    5165           $propix++; 
     5164          ++$propix; 
    51665165        if( !isset( $this->comment[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    51675166        return ( $inclParam ) ? $this->comment[$propix] : $this->comment[$propix]['value']; 
     
    51735172        $ak = ( is_array( $this->contact )) ? array_keys( $this->contact ) : array(); 
    51745173        while( is_array( $this->contact ) && !isset( $this->contact[$propix] ) && ( 0 < count( $this->contact )) && ( $propix < end( $ak ))) 
    5175           $propix++; 
     5174          ++$propix; 
    51765175        if( !isset( $this->contact[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    51775176        return ( $inclParam ) ? $this->contact[$propix] : $this->contact[$propix]['value']; 
     
    51835182        $ak = ( is_array( $this->description )) ? array_keys( $this->description ) : array(); 
    51845183        while( is_array( $this->description ) && !isset( $this->description[$propix] ) && ( 0 < count( $this->description )) && ( $propix < end( $ak ))) 
    5185           $propix++; 
     5184          ++$propix; 
    51865185        if( !isset( $this->description[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    51875186        return ( $inclParam ) ? $this->description[$propix] : $this->description[$propix]['value']; 
     
    52115210        $ak = ( is_array( $this->exdate )) ? array_keys( $this->exdate ) : array(); 
    52125211        while( is_array( $this->exdate ) && !isset( $this->exdate[$propix] ) && ( 0 < count( $this->exdate )) && ( $propix < end( $ak ))) 
    5213           $propix++; 
     5212          ++$propix; 
    52145213        if( !isset( $this->exdate[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    52155214        return ( $inclParam ) ? $this->exdate[$propix] : $this->exdate[$propix]['value']; 
     
    52185217        $ak = ( is_array( $this->exrule )) ? array_keys( $this->exrule ) : array(); 
    52195218        while( is_array( $this->exrule ) && !isset( $this->exrule[$propix] ) && ( 0 < count( $this->exrule )) && ( $propix < end( $ak ))) 
    5220           $propix++; 
     5219          ++$propix; 
    52215220        if( !isset( $this->exrule[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    52225221        return ( $inclParam ) ? $this->exrule[$propix] : $this->exrule[$propix]['value']; 
     
    52255224        $ak = ( is_array( $this->freebusy )) ? array_keys( $this->freebusy ) : array(); 
    52265225        while( is_array( $this->freebusy ) && !isset( $this->freebusy[$propix] ) && ( 0 < count( $this->freebusy )) && ( $propix < end( $ak ))) 
    5227           $propix++; 
     5226          ++$propix; 
    52285227        if( !isset( $this->freebusy[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    52295228        return ( $inclParam ) ? $this->freebusy[$propix] : $this->freebusy[$propix]['value']; 
     
    52705269        $ak = ( is_array( $this->requeststatus )) ? array_keys( $this->requeststatus ) : array(); 
    52715270        while( is_array( $this->requeststatus ) && !isset( $this->requeststatus[$propix] ) && ( 0 < count( $this->requeststatus )) && ( $propix < end( $ak ))) 
    5272           $propix++; 
     5271          ++$propix; 
    52735272        if( !isset( $this->requeststatus[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    52745273        return ( $inclParam ) ? $this->requeststatus[$propix] : $this->requeststatus[$propix]['value']; 
     
    52775276        $ak = ( is_array( $this->resources )) ? array_keys( $this->resources ) : array(); 
    52785277        while( is_array( $this->resources ) && !isset( $this->resources[$propix] ) && ( 0 < count( $this->resources )) && ( $propix < end( $ak ))) 
    5279           $propix++; 
     5278          ++$propix; 
    52805279        if( !isset( $this->resources[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    52815280        return ( $inclParam ) ? $this->resources[$propix] : $this->resources[$propix]['value']; 
     
    52845283        $ak = ( is_array( $this->rrule )) ? array_keys( $this->rrule ) : array(); 
    52855284        while( is_array( $this->rrule ) && !isset( $this->rrule[$propix] ) && ( 0 < count( $this->rrule )) && ( $propix < end( $ak ))) 
    5286           $propix++; 
     5285          ++$propix; 
    52875286        if( !isset( $this->rrule[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    52885287        return ( $inclParam ) ? $this->rrule[$propix] : $this->rrule[$propix]['value']; 
     
    53095308        $ak = ( is_array( $this->tzname )) ? array_keys( $this->tzname ) : array(); 
    53105309        while( is_array( $this->tzname ) && !isset( $this->tzname[$propix] ) && ( 0 < count( $this->tzname )) && ( $propix < end( $ak ))) 
    5311           $propix++; 
     5310          ++$propix; 
    53125311        if( !isset( $this->tzname[$propix] )) { unset( $this->propix[$propName] ); return FALSE; } 
    53135312        return ( $inclParam ) ? $this->tzname[$propix] : $this->tzname[$propix]['value']; 
     
    53465345                                    : array( $xpropkey, $this->xprop[$xpropkey]['value'] ); 
    53475346            else 
    5348               $xpropno++; 
     5347              ++$xpropno; 
    53495348          } 
    53505349          return FALSE; // not found ?? 
     
    54315430      return FALSE; 
    54325431    $arglist[0] = strtoupper( $arglist[0] ); 
    5433     for( $argix=$numargs; $argix < 12; $argix++ ) { 
     5432    for( $argix=$numargs; $argix < 12; ++$argix ) { 
    54345433      if( !isset( $arglist[$argix] )) 
    54355434        $arglist[$argix] = null; 
     
    56135612          $proprows[$lastix] = $proprows[$lastix]; 
    56145613        $newProp = FALSE; 
    5615         $lastix++; 
     5614        ++$lastix; 
    56165615        $proprows[$lastix]  = $line; 
    56175616      } 
     
    56275626            /* get propname, (problem with x-properties, otherwise in previous loop) */ 
    56285627      $cix = $propname = null; 
    5629       for( $cix=0, $clen = strlen( $line ); $cix < $clen; $cix++ ) { 
     5628      for( $cix=0, $clen = strlen( $line ); $cix < $clen; ++$cix ) { 
    56305629        if( in_array( $line[$cix], array( ':', ';' ))) 
    56315630          break; 
     
    56445643      $attrix = -1; 
    56455644      $clen = strlen( $line ); 
    5646       for( $cix=0; $cix < $clen; $cix++ ) { 
     5645      for( $cix=0; $cix < $clen; ++$cix ) { 
    56475646        if((       ':'   == $line[$cix] )             && 
    56485647                 ( '://' != substr( $line, $cix, 3 )) && 
     
    56945693            $content  = explode( ',', $line ); 
    56955694            $clen     = count( $content ); 
    5696             for( $cix = 0; $cix < $clen; $cix++ ) { 
     5695            for( $cix = 0; $cix < $clen; ++$cix ) { 
    56975696              if( "\\" == substr($content[$cix], -1)) { 
    56985697                $content[$cix] .= ','.$content[$cix + 1]; 
    56995698                unset($content[$cix + 1]); 
    5700                 $cix++; 
     5699                ++$cix; 
    57015700              } 
    57025701            } 
     
    58995898          return TRUE; 
    59005899        } 
    5901         $cix2dC++; 
     5900        ++$cix2dC; 
    59025901      } 
    59035902      elseif( !$argType && ($arg1 == $component->getProperty( 'uid' ))) { 
     
    59505949         if( $index == $cix2gC ) 
    59515950           return $component->copy(); 
    5952          $cix2gC++; 
     5951         ++$cix2gC; 
    59535952      } 
    59545953      elseif( !$argType && ( $arg1 == $component->getProperty( 'uid' ))) 
     
    60436042          return TRUE; 
    60446043        } 
    6045         $cix2sC++; 
     6044        ++$cix2sC; 
    60466045      } 
    60476046      elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) { // UID insert/replace 
     
    61306129      $bytecnt = strlen( $tmp ); 
    61316130      $charCnt = $ix = 0; 
    6132       for( $ix = 0; $ix < $bytecnt; $ix++ ) { 
     6131      for( $ix = 0; $ix < $bytecnt; ++$ix ) { 
    61336132        if(( 73 < $charCnt ) && ( '\n' == substr( $tmp, $ix, $eolcharlen ))) { 
    61346133          $ix += $eolcharlen; 
Note: See TracChangeset for help on using the changeset viewer.