Ignore:
Timestamp:
09/26/13 15:41:49 (11 years ago)
Author:
angelo
Message:

Ticket #3491 - Compatibilizar Expresso com novas versoes do PHP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.5.1-evolucao/phpgwapi/inc/adodb/adodb-iterator.inc.php

    r34 r8222  
    22 
    33/* 
    4   V4.94 23 Jan 2007  (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 
     4  V5.18 3 Sep 2012   (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. 
    55  Released under both BSD license and Lesser GPL library license.  
    66  Whenever there is any discrepancy between the two licenses,  
     
    1919                 
    2020        Iterator code based on http://cvs.php.net/cvs.php/php-src/ext/spl/examples/cachingiterator.inc?login=2 
     21         
     22         
     23        Moved to adodb.inc.php to improve performance. 
    2124 */ 
    2225  
    2326 
    24  class ADODB_Iterator implements Iterator { 
    2527 
    26     private $rs; 
    27  
    28     function __construct($rs)  
    29         { 
    30         $this->rs = $rs; 
    31     } 
    32     function rewind()  
    33         { 
    34         $this->rs->MoveFirst(); 
    35     } 
    36  
    37         function valid()  
    38         { 
    39         return !$this->rs->EOF; 
    40     } 
    41          
    42     function key()  
    43         { 
    44         return $this->rs->_currentRow; 
    45     } 
    46          
    47     function current()  
    48         { 
    49         return $this->rs->fields; 
    50     } 
    51          
    52     function next()  
    53         { 
    54         $this->rs->MoveNext(); 
    55     } 
    56          
    57         function __call($func, $params) 
    58         { 
    59                 return call_user_func_array(array($this->rs, $func), $params); 
    60         } 
    61  
    62          
    63         function hasMore() 
    64         { 
    65                 return !$this->rs->EOF; 
    66         } 
    67  
    68 } 
    69  
    70  
    71 class ADODB_BASE_RS implements IteratorAggregate { 
    72     function getIterator() { 
    73         return new ADODB_Iterator($this); 
    74     } 
    75          
    76         /* this is experimental - i don't really know what to return... */ 
    77         function __toString() 
    78         { 
    79                 include_once(ADODB_DIR.'/toexport.inc.php'); 
    80                 return _adodb_export($this,',',',',false,true); 
    81         } 
    82 }  
    8328 
    8429 
Note: See TracChangeset for help on using the changeset viewer.