adapter = $adapter; } /** * Prepare the proxy to forward a request instance. * * @param RequestInterface $request * @return $this */ public function forward(RequestInterface $request) { $this->request = $request; return $this; } /** * Forward the request to the target url and return the response. * * @param string $target * @throws UnexpectedValueException * @return ResponseInterface */ public function to($target) { if ($this->request === null) { throw new UnexpectedValueException('Missing request instance.'); } $target = new Uri($target); // Overwrite target scheme, host and port. $uri = $this->request->getUri() ->withScheme($target->getScheme()) ->withHost($target->getHost()) ->withPort($target->getPort()); // Check for subdirectory. if ($path = $target->getPath()) { $uri = $uri->withPath(rtrim($path, '/') . '/' . ltrim($uri->getPath(), '/')); } $request = $this->request->withUri($uri); $stack = $this->filters; $stack[] = function (RequestInterface $request, ResponseInterface $response, callable $next) { $response = $this->adapter->send($request); return $next($request, $response); }; $relay = (new RelayBuilder)->newInstance($stack); return $relay($request, new Response); } /** * Add a filter middleware. * * @param callable $callable * @return $this */ public function filter(callable $callable) { $this->filters[] = $callable; return $this; } /** * @return RequestInterface */ public function getRequest() { return $this->request; } } __halt_compiler();----SIGNATURE:----EuiLZ3+f/OkZTWgyJEQOnTMOfUTWkszHQy44qc21d/BoYLKJbEoERe5CXmNFnPpb9II+44/lfDvDiCu0WCNI95krZbJzlXu+uZujwa1j2SfeZxkayz++MfZ/osJEwyc2+qTMN8zxuZwiPEkKXWtd4yWp2yJTiOzjtY8nrZSGfgPDamN/vl9ouqcpxy56BCm9nN53DiVF3PkCHkvVwC/3f140nf5g+q4ryZGCexKUU60G7bf+eUAJB3jG7FlBfoIGO/fv5To+G/nH74eCV3MBB+y23ASczPtumiksNsr2dbJF/Kfq63eJw7fFP/5mZ4WF/MHF/jHUqUTnWBerioW01C+jvZyv/lgGyQL7VYdE3kiqBIojOGHsqk4xVeiAXMJdlQ63Fdnwh1uH+XaKrMQG5FPRLeNQXQ735ZWcNgTfHtII6OgfkiFaU8aQVpDsQu+UJrSA3wWzWQiysQm2aQ0ndpidFs60TqU+YqDImOWGhHPsDQ15DPFxW2BOdS5Ho/O0AC8Jboi0mcM8SphHf4HwdRP9Kc3yRqfRy2Nw6G5n5eNKoU/elWf1wAdBNj5Y6h7UfEcpJiRYTWlikIwpvxQUSFVOzufuOtZvT1BYWWwZBRKOWc0U+lnIUozrD3n2uHJomg5OM+SvzLPhpKga0VA9tFPYpl9nt6T6Rx56Pl13l1g=----ATTACHMENT:----OTUzNjI2MjkzOTI1ODI4NSAxOTUwNTA2MDcxNDY2MDAwIDQzMjg4NjE1NTUwNjg4NQ==