$message .= \sprintf(' for %s', $uriString);
}
// Create a connection exception if it was a specific error code.
$error = isset($connectionErrors[$easy->errno])
? new ConnectException($message, $easy->request, null, $ctx)
: new RequestException($message, $easy->request, $easy->response, null, $ctx);
return P\Create::rejectionFor($error);
}
// Retry when nothing is present or when curl failed to rewind.
if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
return self::retryFailedRewind($handler, $easy, $ctx);
}
return self::createRejection($easy, $ctx);
}
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
{
static $connectionErrors = [
if (isset($easy->options['on_stats'])) {
self::invokeStats($easy);
}
if (!$easy->response || $easy->errno) {
return self::finishError($handler, $easy, $factory);
}
// Return the response if it is present and there is no error.
$factory->release($easy);
$easy = $this->factory->create($request, $options);
\curl_exec($easy->handle);
$easy->errno = \curl_errno($easy->handle);
return CurlFactory::finish($this, $easy, $this->factory);
}
}
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
*/
public static function wrapSync(callable $default, callable $sync): callable
{
return static function (RequestInterface $request, array $options) use ($default, $sync): PromiseInterface {
return empty($options[RequestOptions::SYNCHRONOUS]) ? $default($request, $options) : $sync($request, $options);
};
}
/**
* Sends streaming requests to a streaming compatible handler while sending
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
*/
public static function wrapStreaming(callable $default, callable $streaming): callable
{
return static function (RequestInterface $request, array $options) use ($default, $streaming): PromiseInterface {
return empty($options['stream']) ? $default($request, $options) : $streaming($request, $options);
};
}
}
}
// Add the expect header if needed.
$this->addExpectHeader($request, $options, $modify);
return $fn(Psr7\Utils::modifyRequest($request, $modify), $options);
}
/**
* Add expect header
*/
public static function cookies(): callable
{
return static function (callable $handler): callable {
return static function ($request, array $options) use ($handler) {
if (empty($options['cookies'])) {
return $handler($request, $options);
} elseif (!($options['cookies'] instanceof CookieJarInterface)) {
throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
}
$cookieJar = $options['cookies'];
$request = $cookieJar->withCookieHeader($request);
if (empty($options['allow_redirects']['max'])) {
return $fn($request, $options);
}
return $fn($request, $options)
->then(function (ResponseInterface $response) use ($request, $options) {
return $this->checkRedirect($request, $options, $response);
});
}
return static function ($request, array $options) use ($handler, $bodySummarizer) {
if (empty($options['http_errors'])) {
return $handler($request, $options);
}
return $handler($request, $options)->then(
static function (ResponseInterface $response) use ($request, $bodySummarizer) {
$code = $response->getStatusCode();
if ($code < 400) {
return $response;
}
*/
public function __invoke(RequestInterface $request, array $options)
{
$handler = $this->resolve();
return $handler($request, $options);
}
/**
* Dumps a string representation of the stack.
*
$request = $this->applyOptions($request, $options);
/** @var HandlerStack $handler */
$handler = $options['handler'];
try {
return P\Create::promiseFor($handler($request, $options));
} catch (\Exception $e) {
return P\Create::rejectionFor($e);
}
}
}
$request = new Psr7\Request($method, $uri, $headers, $body, $version);
// Remove the option so that they are not doubly-applied.
unset($options['headers'], $options['body'], $options['version']);
return $this->transfer($request, $options);
}
/**
* Create and send an HTTP request.
*
*/
public function request(string $method, $uri = '', array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->requestAsync($method, $uri, $options)->wait();
}
/**
* Get a client configuration option.
*
*
* @throws GuzzleException
*/
public function post($uri, array $options = []): ResponseInterface
{
return $this->request('POST', $uri, $options);
}
/**
* Create and send an HTTP PATCH request.
*
$url = $this->apiUrl . $action;
$url .= strpos($url, '?') !== false ? '&' : '?';
$url .= 'token=' . $this->token;
$response = $this->client->post($url, [
'json' => $params,
]);
$responseContents = json_decode($response->getBody()->getContents());
return $responseContents->entries ?? [];
return $sitemap->toResponse($request);
}
public function blog($categorySlug = null): View
{
$blogCategories = $this->cockpitService->getBlogCategories();
$categoryDisplay = null;
$indexCategoryInFilter = $categorySlug ? array_search($categorySlug, array_column($blogCategories, 'title_slug')) : '';
if (is_numeric($indexCategoryInFilter)) {
$categoryDisplay = $blogCategories[$indexCategoryInFilter]->title;
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed ...$args
* @return mixed
*/
public static function unwrapIfClosure($value, ...$args)
{
return $value instanceof Closure ? $value(...$args) : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
$this->buildStack[] = $className;
$pushedToBuildStack = true;
}
$result = BoundMethod::call($this, $callback, $parameters, $defaultMethod);
if ($pushedToBuildStack) {
array_pop($this->buildStack);
}
*/
protected function callControllerCallable(callable $callable, array $parameters = [])
{
try {
return $this->prepareResponse(
$this->call($callable, $parameters)
);
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
if (count($middleware) > 0) {
return $this->callLumenControllerWithMiddleware(
$instance, $method, $routeInfo, $middleware
);
} else {
return $this->callControllerCallable(
[$instance, $method], $routeInfo[2]
);
}
}
if (! method_exists($instance = $this->make($controller), $method)) {
throw new NotFoundHttpException;
}
if ($instance instanceof LumenController) {
return $this->callLumenController($instance, $method, $routeInfo);
} else {
return $this->callControllerCallable(
[$instance, $method], $routeInfo[2]
);
}
protected function callActionOnArrayBasedRoute($routeInfo)
{
$action = $routeInfo[1];
if (isset($action['uses'])) {
return $this->prepareResponse($this->callControllerAction($routeInfo));
}
foreach ($action as $value) {
if ($value instanceof Closure) {
$callable = $value->bindTo(new RoutingClosure);
return $this->callActionOnArrayBasedRoute($this['request']->route());
}));
}
return $this->prepareResponse(
$this->callActionOnArrayBasedRoute($routeInfo)
);
}
/**
* Call the Closure or invokable on the array based route.
case Dispatcher::NOT_FOUND:
throw new NotFoundHttpException;
case Dispatcher::METHOD_NOT_ALLOWED:
throw new MethodNotAllowedHttpException($routeInfo[1]);
case Dispatcher::FOUND:
return $this->handleFoundRoute($routeInfo);
}
}
/**
* Handle a route found by the dispatcher.
if (isset($this->router->getRoutes()[$method.$pathInfo])) {
return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
}
return $this->handleDispatcherResponse(
$this->createDispatcher()->dispatch($method, $pathInfo)
);
});
} catch (Throwable $e) {
return $this->prepareResponse($this->sendExceptionToHandler($e));
->send($this->make('request'))
->through($middleware)
->then($then);
}
return $then($this->make('request'));
}
/**
* Prepare the response for sending.
*
[$method, $pathInfo] = $this->parseIncomingRequest($request);
try {
$this->boot();
return $this->sendThroughPipeline($this->middleware, function ($request) use ($method, $pathInfo) {
$this->instance(Request::class, $request);
if (isset($this->router->getRoutes()[$method.$pathInfo])) {
return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
}
* @param \Symfony\Component\HttpFoundation\Request|null $request
* @return void
*/
public function run($request = null)
{
$response = $this->dispatch($request);
if ($response instanceof SymfonyResponse) {
$response->send();
} else {
echo (string) $response;
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$app->run();
ConnectException
|
---|
GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: adm.imobiliariaperez.com.br (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://adm.imobiliariaperez.com.br/api/collections/get/category?token=ae38dfee8fac2ff9149c835bbf9fcf at /home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210 at GuzzleHttp\Handler\CurlFactory::createRejection() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:158) at GuzzleHttp\Handler\CurlFactory::finishError() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:110) at GuzzleHttp\Handler\CurlFactory::finish() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:47) at GuzzleHttp\Handler\CurlHandler->__invoke() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28) at GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:48) at GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:64) at GuzzleHttp\PrepareBodyMiddleware->__invoke() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Middleware.php:31) at GuzzleHttp\Middleware::GuzzleHttp\{closure}() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:71) at GuzzleHttp\RedirectMiddleware->__invoke() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Middleware.php:66) at GuzzleHttp\Middleware::GuzzleHttp\{closure}() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/HandlerStack.php:75) at GuzzleHttp\HandlerStack->__invoke() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Client.php:333) at GuzzleHttp\Client->transfer() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Client.php:169) at GuzzleHttp\Client->requestAsync() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/Client.php:189) at GuzzleHttp\Client->request() (/home/imobi239/public_html/vendor/guzzlehttp/guzzle/src/ClientTrait.php:95) at GuzzleHttp\Client->post() (/home/imobi239/public_html/app/Services/CockpitService.php:75) at App\Services\CockpitService->getBlogCategories() (/home/imobi239/public_html/app/Controllers/SiteController.php:174) at App\Controllers\SiteController->blog() (/home/imobi239/public_html/vendor/illuminate/container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/imobi239/public_html/vendor/illuminate/container/Util.php:41) at Illuminate\Container\Util::unwrapIfClosure() (/home/imobi239/public_html/vendor/illuminate/container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/home/imobi239/public_html/vendor/illuminate/container/BoundMethod.php:35) at Illuminate\Container\BoundMethod::call() (/home/imobi239/public_html/vendor/illuminate/container/Container.php:662) at Illuminate\Container\Container->call() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:391) at Laravel\Lumen\Application->callControllerCallable() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:356) at Laravel\Lumen\Application->callLumenController() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:331) at Laravel\Lumen\Application->callControllerAction() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:284) at Laravel\Lumen\Application->callActionOnArrayBasedRoute() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:269) at Laravel\Lumen\Application->handleFoundRoute() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:239) at Laravel\Lumen\Application->handleDispatcherResponse() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:174) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:431) at Laravel\Lumen\Application->sendThroughPipeline() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:167) at Laravel\Lumen\Application->dispatch() (/home/imobi239/public_html/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/home/imobi239/public_html/public/index.php:38) |