| Server IP : 172.173.179.141 / Your IP : 216.73.216.196 Web Server : Apache System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.2.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/erp/htdocs/includes/odtphp/ |
Upload File : |
<?php
/**
* Segments iterator
* You need PHP 5.2 at least
* You need Zip Extension or PclZip library
*
* @copyright GPL License 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
* @license https://www.gnu.org/copyleft/gpl.html GPL License
* @version 1.3
*/
class SegmentIterator implements RecursiveIterator
{
private $ref;
private $key;
public function __construct(array $ref)
{
$this->ref = $ref;
$this->key = 0;
$this->keys = array_keys($this->ref);
}
public function hasChildren()
{
return $this->valid() && $this->current() instanceof Segment;
}
public function current()
{
return $this->ref[$this->keys[$this->key]];
}
function getChildren()
{
return new self($this->current()->children);
}
public function key()
{
return $this->key;
}
public function valid()
{
return array_key_exists($this->key, $this->keys);
}
public function rewind()
{
$this->key = 0;
}
public function next()
{
$this->key ++;
}
}