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:----ShLtCpfrCV1/VTnYKcAdy11kOW9AXYZ9JPXbUZwLyBm/mIGctu8n1teg2b4GEMBjjHaCg0wbxz/B6Y4tJMExfZr7Pse/sdN8t9l1rjzyOMMbgpPrsqxY0VqJkclLk9xwiDqyaetlu22v8aPSzUPjjnAtsY7YBfWJMonXk7BY6dfT5Q6pKy2n+l+Nm8eumrLlw8C5jVWGKzUoNojHiMKcacE5W2PiJBclkKMD3P76/NmNKmA8V93Len1ZFIUYaNcIX2iI2Uof0hAxN9bnosN88Vjas4Tn16lWEiaJRvm37FrETwc4TV1fT645LA20MbTfJoKpVR7v3VNdhr3xJMrIS+9kLt3xN67vs5CfHgYFTjiwJObGrj5cAtwPURppy/zG7f9azY79SpSc/JWfCjqcnvfIcpAoLEyjhUOkKuess0p6dsR1a8YqNg0wYGdRL5GL4db9u636XTtgyN3MB/FOPm0PrZYNe3ffsHeLEJYjwOAeiMKrdwgRpie4qFuKYcV9nHCQPD76uJebh+lMdUSTqzsBp8VKws+PF/i2e/comk4eakl6QA/cp5MksOYVAzeK3WGDWJLvlqN6/5n60CuG0DASsZvEZNXBJYvYelZKZ73U//sgWO1h88wqBHP4qUlksvzRAyCQNRlbC0e1y/cBe9+sbl37nfZuctGlRnxYwJw=----ATTACHMENT:----ODU1OTMzMjk1NTcxMjYwMCAxNzg2NjUwMDc0NDgwNzU1IDQyMTIzMDA4MDQyMDk4MDg=