Example #1
0
 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);
 }
Example #2
0
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);
}