public function readAll($cb, $pri = EIO_PRI_DEFAULT)
{
$cb = CallbackWrapper::forceWrap($cb);
if (!$this->fd) {
if ($cb) {
$cb($this, false);
}
return false;
}
$this->statRefresh(function ($file, $stat) use($cb, $pri) {
if (!$stat) {
if ($cb) {
$cb($file, false);
}
return;
}
$offset = 0;
$buf = '';
$size = $stat['size'];
eio_read($file->fd, min($file->chunkSize, $size), 0, $pri, $this->readAllGenHandler($cb, $size, $offset, $pri, $buf), $file);
}, $pri);
return true;
}