public function write(Tag $tag)
 {
     \tool::fprint("Writing ... " . get_called_class() . "@{$this->file->ftell()}");
     $tmp = new SplFileObject('php://memory', 'wb+');
     $tag->save($tmp);
     $pos = $tmp->ftell();
     $tmp->fseek(0);
     return $this->file->fwrite(gzencode($tmp->fread($pos), 9, FORCE_GZIP));
 }
示例#2
0
 public function __construct($name = null, $content = array())
 {
     \tool::fprint("Creating " . get_called_class() . (count($content) ? " with " . count($content) . " elements" : ''));
     parent::__construct();
     $this->name = $name;
     $this->content = $content ? (array) $content : array();
 }
示例#3
0
 public function write(Tag $tag)
 {
     \tool::fprint("Writing ... " . get_called_class() . "@{$this->file->ftell()}");
     return $tag->save($this->file);
 }
示例#4
0
 public function save(SplFileObject $file)
 {
     return parent::save($file) + $file->fwrite(static::store($this->value));
 }