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:----LnfoGHjOwyPFpIz8sb0hSjg1ouLzP3Lv0uv40dnh3HqfHpgCXf10ZquydaRFXO7U7KtTo81Gw3Z1hZa7bSubVhYE9hDApTMoaBJ/woQMpDFplFDSv696eU1QSMP1IsOzddD1r97cCBJE4uuKPKgEX9+XOYsC1G1RkznsRjLCXABxyCaa7Gdljo+di1swwBauipMqhLb1uAC5MOVIp9QcMM1NvE5NLNb3dXmuWlWaKOnqtYDJFJSznt1hexTUJH3NtiyjxwQEAjOoKixlLdiUsubXfLy/mbbnUtZ0nnTzFbsuSgnlypB27C5h9f1fMxWGIvJ7MS7panmEKUu3zUoQ4vV9+n386AMvcEXV8mEjnoFRYHZaiOhctP1JGq0FA2mTWfJQ3PbopcKkQ6fuB2olgriQbKyZSj1rAN8kEw2syq8Mmste2bSVt1ffd6SeYWLSuvIvmqRaGQ4Wrrc2VIro+of/qvNiVOgw+Y62eSuNkvZlAA88OUaluwvCErToTUubMY+tF2gbsQs0z3jLx2nFPUEEGfz8yXBKXbpgT5sABx+A7s34uSm7eSRhHNlQ7PQTLsHuwOpt6XyYEO3iHxdxFys7+dXy3MRSZ9J1lsdJIVIplwtkSjUWfehqd2j4WWPAMctwUYGiDQ22FvR3qcg9RqI0kHxt9SqsqCtcvtdT1Z4=----ATTACHMENT:----MjIyOTAwODg4MzU2NjU2OSAxMDEwMDM3NTI4OTczOTcyIDYyNjQxNzc0NjIxMjEzNQ==