芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/giga.mgaplay.com.br/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php
streamFactory = $streamFactory; $this->style = $style; if (!in_array($style, [static::APPEND, static::PREPEND], true)) { throw new InvalidArgumentException("Invalid style `{$style}`. Must be `append` or `prepend`"); } } /** * @param ServerRequestInterface $request * @param RequestHandlerInterface $handler * @return ResponseInterface * @throws Throwable */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { try { ob_start(); $response = $handler->handle($request); $output = ob_get_clean(); } catch (Throwable $e) { ob_end_clean(); throw $e; } if (!empty($output)) { if ($this->style === static::PREPEND) { $body = $this->streamFactory->createStream(); $body->write($output . $response->getBody()); $response = $response->withBody($body); } elseif ($this->style === static::APPEND && $response->getBody()->isWritable()) { $response->getBody()->write($output); } } return $response; } }