Closed Leechael closed 9 years ago
The dirty and quick solution works for me:
public function writeStream($path, $resource, Config $config)
{
if (! $this->source->writeStream($path, $resource, $config)) {
return false;
}
if (fseek($resource, 0) === 0) {
return $this->replica->writeStream($path, $resource, $config);
} else {
$src = $this->source->readStream($path);
return $this->replica->writeStream($path, $src, $config);
}
}
@frankdejonge This can be closed as well.
For case like:
But the file on replica will be zero bytes. The possible solution are do
fseek
before write to replica; but some streams aren't seek-able.Any comment?