if (version_compare(phpversion('redis'), '5.3.0', '>=') && ! is_null($context = Arr::get($config, 'context'))) {
$parameters[] = $context;
}
$client->{$persistent ? 'pconnect' : 'connect'}(...$parameters);
}
/**
* Create a new redis cluster instance.
*
if (version_compare(phpversion('redis'), '5.3.0', '>=') && ! is_null($context = Arr::get($config, 'context'))) {
$parameters[] = $context;
}
$client->{$persistent ? 'pconnect' : 'connect'}(...$parameters);
}
/**
* Create a new redis cluster instance.
*
? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
: 'Please make sure the PHP Redis extension is installed and enabled.'
);
}
$this->establishConnection($client, $config);
if (! empty($config['password'])) {
if (isset($config['username']) && $config['username'] !== '' && is_string($config['password'])) {
$client->auth([$config['username'], $config['password']]);
} else {
{
if (is_null($callback)) {
return new HigherOrderTapProxy($value);
}
$callback($value);
return $value;
}
}
*
* @throws \LogicException
*/
protected function createClient(array $config)
{
return tap(new Redis, function ($client) use ($config) {
if ($client instanceof RedisFacade) {
throw new LogicException(
extension_loaded('redis')
? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
: 'Please make sure the PHP Redis extension is installed and enabled.'
if (isset($config['prefix'])) {
$formattedOptions['prefix'] = $config['prefix'];
}
$connector = function () use ($config, $options, $formattedOptions) {
return $this->createClient(array_merge(
$config, $options, $formattedOptions
));
};
return new PhpRedisConnection($connector(), $connector, $config);
return $this->createClient(array_merge(
$config, $options, $formattedOptions
));
};
return new PhpRedisConnection($connector(), $connector, $config);
}
/**
* Create a new clustered PhpRedis connection.
*
$name = $name ?: 'default';
$options = $this->config['options'] ?? [];
if (isset($this->config[$name])) {
return $this->connector()->connect(
$this->parseConnectionConfiguration($this->config[$name]),
array_merge(Arr::except($options, 'parameters'), ['parameters' => Arr::get($options, 'parameters.'.$name, Arr::get($options, 'parameters', []))])
);
}
if (isset($this->connections[$name])) {
return $this->connections[$name];
}
return $this->connections[$name] = $this->configure(
$this->resolve($name), $name
);
}
/**
* Resolve the given connection by name.
*
* @return \Illuminate\Redis\Connections\Connection
*/
public function connection()
{
return $this->redis->connection($this->connection);
}
/**
* Get the Redis connection instance that should be used to manage locks.
*
* @param string|array $key
* @return mixed
*/
public function get($key)
{
$value = $this->connection()->get($this->prefix.$key);
return ! is_null($value) ? $this->unserialize($value) : null;
}
/**
{
if (is_array($key)) {
return $this->many($key);
}
$value = $this->store->get($this->itemKey($key));
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
if (is_null($value)) {
* @param \Closure(): TCacheValue $callback
* @return TCacheValue
*/
public function rememberForever($key, Closure $callback)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately
// and if not we will execute the given Closure and cache the result
// of that forever so it is available for all subsequent requests.
if (! is_null($value)) {
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->store()->$method(...$parameters);
}
}
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
return $instance->$method(...$args);
}
}
class PageRedirector implements Redirector
{
public function getRedirectsFor(Request $request): array
{
return \Cache::rememberForever('page_redirects', function () {
return Redirects::all()->pluck('from', 'to')->toArray();
});
}
}
*
* @return \Illuminate\Http\Response|null
*/
public function getRedirectFor(Request $request)
{
$redirects = $this->redirector->getRedirectsFor($request);
collect($redirects)->each(function ($redirects, $missingUrl) {
if (Str::contains($missingUrl, '*')) {
$missingUrl = str_replace('*', '{wildcard}', $missingUrl);
}
if (! $this->shouldRedirect($response)) {
return $response;
}
$redirectResponse = app(MissingPageRouter::class)->getRedirectFor($request);
return $redirectResponse ?? $response;
}
protected function shouldRedirect($response): bool
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
*/
public function handle($request, Closure $next)
{
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
if ($callback($request)) {
return $next($request);
}
}
return parent::handle($request, $next);
}
/**
* Transform the given value.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
*/
public function handle($request, Closure $next)
{
$this->clean($request);
return $next($request);
}
/**
* Clean the request's data.
*
if ($callback($request)) {
return $next($request);
}
}
return parent::handle($request, $next);
}
/**
* Transform the given value.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
throw new PostTooLargeException;
}
return $next($request);
}
/**
* Determine the server 'post_max_size' as bytes.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
null,
$this->getHeaders($data)
);
}
return $next($request);
}
/**
* Determine if the incoming request has a maintenance mode bypass cookie.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
* @return \Illuminate\Http\Response
*/
public function handle($request, Closure $next)
{
if (! $this->hasMatchingPath($request)) {
return $next($request);
}
$this->cors->setOptions($this->container['config']->get('cors', []));
if ($this->cors->isPreflightRequest($request)) {
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
{
$request::setTrustedProxies([], $this->getTrustedHeaderNames());
$this->setTrustedProxyIpAddresses($request);
return $next($request);
}
/**
* Sets the trusted proxies on the request.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
{
if ($this->app->bound(HubInterface::class)) {
$this->startTransaction($request, $this->app->make(HubInterface::class));
}
return $next($request);
}
/**
* Handle the application termination.
*
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}
/**
* Bootstrap the application for HTTP requests.
*
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
RedisException
|
---|
RedisException: Connection refused at /www/2024/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:159 at Redis->connect() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:159) at Illuminate\Redis\Connectors\PhpRedisConnector->establishConnection() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:88) at Illuminate\Redis\Connectors\PhpRedisConnector->Illuminate\Redis\Connectors\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Support/helpers.php:307) at tap() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:79) at Illuminate\Redis\Connectors\PhpRedisConnector->createClient() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:33) at Illuminate\Redis\Connectors\PhpRedisConnector->Illuminate\Redis\Connectors\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:38) at Illuminate\Redis\Connectors\PhpRedisConnector->connect() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php:110) at Illuminate\Redis\RedisManager->resolve() (/www/2024/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php:91) at Illuminate\Redis\RedisManager->connection() (/www/2024/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:330) at Illuminate\Cache\RedisStore->connection() (/www/2024/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:65) at Illuminate\Cache\RedisStore->get() (/www/2024/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:98) at Illuminate\Cache\Repository->get() (/www/2024/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:428) at Illuminate\Cache\Repository->rememberForever() (/www/2024/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:429) at Illuminate\Cache\CacheManager->__call() (/www/2024/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:355) at Illuminate\Support\Facades\Facade::__callStatic() (/www/2024/app/Http/Controllers/PageRedirector.php:14) at App\Http\Controllers\PageRedirector->getRedirectsFor() (/www/2024/vendor/spatie/laravel-missing-page-redirector/src/MissingPageRouter.php:35) at Spatie\MissingPageRedirector\MissingPageRouter->getRedirectFor() (/www/2024/vendor/spatie/laravel-missing-page-redirector/src/RedirectsMissingPages.php:18) at Spatie\MissingPageRedirector\RedirectsMissingPages->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31) at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21) at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:40) at Illuminate\Foundation\Http\Middleware\TrimStrings->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27) at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:99) at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:49) at Illuminate\Http\Middleware\HandleCors->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:39) at Illuminate\Http\Middleware\TrustProxies->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php:97) at Sentry\Laravel\Tracing\Middleware->handle() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/2024/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119) at Illuminate\Pipeline\Pipeline->then() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/www/2024/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144) at Illuminate\Foundation\Http\Kernel->handle() (/www/2024/public/index.php:51) |