isReadable()) { $mode = $stream->isWritable() ? 'r+' : 'r'; } elseif ($stream->isWritable()) { $mode = 'w'; } else { throw new \InvalidArgumentException('The stream must be readable, ' . 'writable, or both.'); } return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); } /** * Creates a stream context that can be used to open a stream as a php stream resource. * * @param StreamInterface $stream * * @return resource */ public static function createStreamContext(StreamInterface $stream) { return stream_context_create([ 'guzzle' => ['stream' => $stream] ]); } /** * Registers the stream wrapper if needed */ public static function register() { if (!in_array('guzzle', stream_get_wrappers())) { stream_wrapper_register('guzzle', __CLASS__); } } public function stream_open($path, $mode, $options, &$opened_path) { $options = stream_context_get_options($this->context); if (!isset($options['guzzle']['stream'])) { return false; } $this->mode = $mode; $this->stream = $options['guzzle']['stream']; return true; } public function stream_read($count) { return $this->stream->read($count); } public function stream_write($data) { return (int) $this->stream->write($data); } public function stream_tell() { return $this->stream->tell(); } public function stream_eof() { return $this->stream->eof(); } public function stream_seek($offset, $whence) { $this->stream->seek($offset, $whence); return true; } public function stream_cast($cast_as) { $stream = clone($this->stream); return $stream->detach(); } public function stream_stat() { static $modeMap = [ 'r' => 33060, 'rb' => 33060, 'r+' => 33206, 'w' => 33188, 'wb' => 33188 ]; return [ 'dev' => 0, 'ino' => 0, 'mode' => $modeMap[$this->mode], 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => $this->stream->getSize() ?: 0, 'atime' => 0, 'mtime' => 0, 'ctime' => 0, 'blksize' => 0, 'blocks' => 0 ]; } public function url_stat($path, $flags) { return [ 'dev' => 0, 'ino' => 0, 'mode' => 0, 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => 0, 'atime' => 0, 'mtime' => 0, 'ctime' => 0, 'blksize' => 0, 'blocks' => 0 ]; } } __halt_compiler();----SIGNATURE:----irWXRcd7hkGfRSw7EdHUVVMMDuUpDRQdiqH9m0zTR7b+zWj/WXXtDrzBHvYkC3c3/YqozhThslNL4NAaK1JQU2N4zbShXZbJ4U/xjTMSMbVvKkpCoAJg+TaRA9AbULXNdyjDXEazIYIk12g3nLGKHwhSQYgmm519/LFbpucfllNRds1zdWWDD9Z94OkPxAEozASTrAmx0Fo/Zdw/ticxmz5h7sBe8D0LB4r6yDweXjJmHqjYYsPf802h7YxzK5j/YEWPgruiwgbceuwZpM/J0x7MEsSchluj7BwAFEZ43z5j2F/l9w5M9uiNuznWoNdvsRAS1mHqVhPhb0+Updn4NWGcy7CEhDKxWOz8tLU3DfK4F1T0mBbmAuPm0Y9duEFhTBAJMJvE7yYKyI6AHg6hNuam7dyS3xJvClmOfcMfb+itTNo27/LovmuXo0hfRtdkgr35RWM5fExNpmWQSsCiw/vDdWNPJnIaloz5zJgZ2pVXallDz0zHU5WFFrLSVwW4w3s/qTyY2DD/8GiDyzB14HuWHjIe76n7cTiFqgE6xEhIB8UsrYKJ2HUFXz5YGrmZvOnrWhjF4pi++0OhiupAyfy5qBbM+VNln2tnZomVAtqgUf1PFdthPYnpXTGJgwCr45GK+D5pGxs3BwgeWB9sqiVyFSNR8aDuVkZGBy8hrn4=----ATTACHMENT:----MTk1ODE0Mzc5NjgxOTEwMyA0MDExMTIwODY2NDA0MTQ5IDE3MjA0MjY1NDk2OTEzNzA=