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:----WWa3mRyd91YNDgc6zrra+XsC1eubT8oiEtUHYhu4O8n2dpca2GiiCE9xaGIGnpBnlOjJLXekMAq1KeYoI/o/rmQ1Oz65Ex2RgLyUNQ4wC6ots/M2+SAsDvhc+GaDpbmtsTZ/bK0ghwEbY5DJfd6HhYjEUSYadxF7cO8787wxkx5Kve8l0zX6Wh0UY++L+o3N8DoFtMfBEr3htA5AK8YOZ93oJSXY4/7LsXAEj0MvqP0Pk+FF+Weij9gMY35agX9ZkRYSZhXM4eXTAYOoMpdaJuQ7G5zSsfXx1fRAW5RrEhp9OlObwm9otBS9MsYDd9MuVEkHDDaC8wXgFOtHomJyjSoqGADGlNtxu9+1MwsSf0LGc3GfdNqcHVB/0hfmEkFnwQIf9CAfv469a3JBHHpdWZ9p6ukUajQjJ8v5d5kEVEZZ7L5Xfo+keqj0COXWPl7pEpHVwgYuhNt+VR+9jpl1ieLu6BDSfCPYI0bFOFwyFWYpFNvSRGNIlZOmnvubcaEa/b5ZfXnZ4M2vNNYIVEHomeozNYLc5++pDuX55B9SuRG6iVUDUFtFOwxNVPHFU72LSSPyRa232LxG4KaFh+TBC5LI7MjAEQB5OjHkhb/z+bfdvBIvtML0VQ/af+yALVGY6DZMjAmbXBQ1YBMzT+SDZcsjPUCYVDFaqItYDz4AWmA=----ATTACHMENT:----NTA2NzY5OTg0Mzg5MjY1MyA5MTUzNTY1MTYxNDc4Nzc1IDU3MjQ2MDMxMjc3MzAzMzU=