function stream_write($data, $lenght = null) { if (is_null($lenght)) { $this->fs->write($data); } else { $this->fs->write(mb_substr($data, 0, $lenght)); } return strlen($data); }
function fwrite(\Nov\CouchDb\Fs\Resource &$f, $data, $lenght = null) { if (is_null($lenght)) { $out = $f->write($data); } else { $out = $f->write(mb_substr($data, 0, $lenght)); } $path = $f->getPath(); $fs = CouchDb\Fs::factory(FSCDB); $f = $fs->open($path); }