/** * Reads and returns $bytes amount of bytes from stream. * * @see http://php.net/streamwrapper.stream-read * * @param int $bytes * * @return string */ public function stream_read($bytes) { if (!$this->currently_opened->isOpenedForReading()) { return null; } $data = $this->currently_opened->read($bytes); //file access time changes so stat cache needs to be cleared clearstatcache(); return $data; }