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)); }
public function write(Tag $tag) { \tool::fprint("Writing ... " . get_called_class() . "@{$this->file->ftell()}"); return $tag->save($this->file); }
public function save(SplFileObject $file) { return parent::save($file) + $file->fwrite(static::store($this->value)); }