current = $current ?? new FileData(); } /** * @param array $args * * @return array|string|bool */ public function __call(string $method, array $args) { $class = __NAMESPACE__.'\\StreamCommand\\'.str_replace('_', '', ucwords($method, '_')).'Command'; if (class_exists($class)) { return $class::run($this->current, ...$args); } return false; } public function dir_closedir(): bool { unset($this->current->dirListing); return true; } public function stream_close(): void { if (!is_resource($this->current->handle)) { // trigger_error( // 'stream_close(): Supplied resource is not a valid stream resource', // E_USER_WARNING // ); return; } if ($this->current->workOnLocalCopy) { fflush($this->current->handle); rewind($this->current->handle); try { $this->current->filesystem->writeStream($this->current->file, $this->current->handle); } catch (FilesystemException $e) { trigger_error( 'stream_close('.$this->current->path.') Unable to sync file : '.$e->getMessage(), E_USER_WARNING ); } } fclose($this->current->handle); } public function stream_flush(): bool { if (!is_resource($this->current->handle)) { trigger_error( 'stream_flush(): Supplied resource is not a valid stream resource', E_USER_WARNING ); return false; } $success = fflush($this->current->handle); if ($this->current->workOnLocalCopy) { fflush($this->current->handle); $currentPosition = ftell($this->current->handle); rewind($this->current->handle); try { $this->current->filesystem->writeStream($this->current->file, $this->current->handle); } catch (FilesystemException $e) { trigger_error( 'stream_flush('.$this->current->path.') Unable to sync file : '.$e->getMessage(), E_USER_WARNING ); $success = false; } if (false !== $currentPosition) { if (is_resource($this->current->handle)) { fseek($this->current->handle, $currentPosition); } } } $this->current->bytesWritten = 0; return $success; } /** * @return array|false */ public function stream_stat() { return $this->url_stat($this->current->path, 0); } public function stream_write(string $data): int { $size = StreamWriteCommand::run($this->current, $data); if ($this->current->writeBufferSize && $this->current->bytesWritten >= $this->current->writeBufferSize) { $this->stream_flush(); } return $size; } } __halt_compiler();----SIGNATURE:----qTjipf0GvN/iq44hXo8XZ+WypksR1aFF+gF/lfMy1IFP/KgPIOm86pKTK0BzrD957spmoR3eou/hZEDCHf+3FYG3q+diLmccgk+PEBcxaQgP7hPiocsFH68cJFxiGfB3OEozQKiPbf+RCEgrSrahFCobDmUWTEOYLlPkMD4Il39I5CmZyImhTdqjRevHnQFgSpC9HCfTaFppdzuna98e90EnMy3g5VLPa+6Ywv/LoNZ4nKBcPCSZcbxHUQL5tKqWsdg10rRvaRkKQGUve8AMutS0xmlaGZomW93I6RgwSOm5CfMs0cWsvxMPJ16/JwNBNdChRY9oGoIjlYzHdJ8XjCND0jGaF3EfjN/36SSHEFIylEJQSYc2jVtTjZF7PjFvv0949IQAv5bT2P02QFn81rKBFyzt0+LbQruzBLXrIK5GaU4qJNJ/HyBWiUQ3Zz3dXVqQ0EAd84awwIPMQReIol+fG1pEkqluwRfbdTVXabW50M3jJavK82ztF3kppW1G5YRJYaf4tvYxWdzSsxgAsF63CfdFy9tW/tH+/FR7Afa3QWg72I5IvG0bAQKbgIP2tFWK71wTarwQYw+sLOuSbPdjmMtQ6y9k/QVEq692UPwI5iVPmA+2XxK+jhPiG1a6RZnefAseRc3cWNOXDdEEI/ciblC4ljRUL5+IksyXrlU=----ATTACHMENT:----NDU5Nzc4NzIyMjYxMjA1OSA2MjcxNzczMTU1NDE0ODk3IDk2ODkzMzc3MzkwMjYxMzQ=