use Illuminate\Filesystem\Filesystem;use Illuminate\Support\Carbon;use SessionHandlerInterface;use Symfony\Component\Finder\Finder;class FileSessionHandler implements SessionHandlerInterface{ /** * The filesystem instance. * * @var \Illuminate\Filesystem\Filesystemuse Illuminate\Filesystem\Filesystem;use Illuminate\Support\Carbon;use SessionHandlerInterface;use Symfony\Component\Finder\Finder;class FileSessionHandler implements SessionHandlerInterface{ /** * The filesystem instance. * * @var \Illuminate\Filesystem\Filesystem * * @param string $file * @return void */ self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); }} */ public function loadClass($class) { if ($file = $this->findFile($class)) { $includeFile = self::$includeFile; $includeFile($file); return true; } return null; */ protected function createNativeDriver() { $lifetime = $this->config->get('session.lifetime'); return $this->buildSession(new FileSessionHandler( $this->container->make('files'), $this->config->get('session.files'), $lifetime )); } /** * * @return \Illuminate\Session\Store */ protected function createFileDriver() { return $this->createNativeDriver(); } /** * Create an instance of the file session driver. * return $this->callCustomCreator($driver); } else { $method = 'create'.Str::studly($driver).'Driver'; if (method_exists($this, $method)) { return $this->$method(); } } throw new InvalidArgumentException("Driver [$driver] not supported."); } // If the given driver has not been created before, we will create the instances // here and cache it so we can return it next time very quickly. If there is // already a driver created by this name, we'll just return that instance. if (! isset($this->drivers[$driver])) { $this->drivers[$driver] = $this->createDriver($driver); } return $this->drivers[$driver]; } * @param \Illuminate\Http\Request $request * @return \Illuminate\Contracts\Session\Session */ public function getSession(Request $request) { return tap($this->manager->driver(), function ($session) use ($request) { $session->setId($request->cookies->get($session->getName())); }); } /** { if (! $this->sessionConfigured()) { return $next($request); } $session = $this->getSession($request); if ($this->manager->shouldBlock() || ($request->route() instanceof Route && $request->route()->locksFor())) { return $this->handleRequestWhileBlocking($request, $session, $next); } // 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); * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $response = $next($request); foreach ($this->cookies->getQueuedCookies() as $cookie) { $response->headers->setCookie($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); * @param \Closure $next * @return \Symfony\Component\HttpFoundation\Response */ public function handle($request, Closure $next) { return $this->encrypt($next($this->decrypt($request))); } /** * Decrypt the cookies 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); { $pipeline = array_reduce( array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination) ); return $pipeline($this->passable); } /** * Run the pipeline and return the result. * $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route); return (new Pipeline($this->container)) ->send($request) ->through($middleware) ->then(function ($request) use ($route) { return $this->prepareResponse( $request, $route->run() ); }); } }); $this->events->dispatch(new RouteMatched($route, $request)); return $this->prepareResponse($request, $this->runRouteWithinStack($route, $request) ); } /** * Run the given route within a Stack "onion" instance. * @param \Illuminate\Http\Request $request * @return \Symfony\Component\HttpFoundation\Response */ public function dispatchToRoute(Request $request) { return $this->runRoute($request, $this->findRoute($request)); } /** * Find the route matching a given request. * */ public function dispatch(Request $request) { $this->currentRequest = $request; return $this->dispatchToRoute($request); } /** * Dispatch the request to a route and return the response. * protected function dispatchToRouter() { return function ($request) { $this->app->instance('request', $request); return $this->router->dispatch($request); }; } /** * Call the terminate method on any terminable middleware. */ protected function prepareDestination(Closure $destination) { return function ($passable) use ($destination) { try { return $destination($passable); } 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); */ public function handle($request, Closure $next) { // Check if we're dealing with CORS and if we should handle it if (! $this->shouldRun($request)) { return $next($request); } // For Preflight, return the Preflight response if ($this->cors->isPreflightRequest($request)) { $response = $this->cors->handlePreflightRequest($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); { $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. * public function handle($request) { 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);|
ErrorException
|
|---|
ErrorException:
Class Illuminate\Session\FileSessionHandler implementing SessionHandlerInterface is missing the create_sid() method which will be required in PHP 9.0
at /var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php:10
at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Class Illuminate\\Session\\FileSessionHandler implementing SessionHandlerInterface is missing the create_sid() method which will be required in PHP 9.0', '/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php', 10)
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php:10)
at include('/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php')
(/var/www/aistability.dk/public_html/vendor/composer/ClassLoader.php:576)
at {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}('/var/www/aistability.dk/public_html/vendor/composer/../laravel/framework/src/Illuminate/Session/FileSessionHandler.php')
(/var/www/aistability.dk/public_html/vendor/composer/ClassLoader.php:427)
at Composer\Autoload\ClassLoader->loadClass('Illuminate\\Session\\FileSessionHandler')
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php:73)
at Illuminate\Session\SessionManager->createNativeDriver()
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php:61)
at Illuminate\Session\SessionManager->createFileDriver()
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Support/Manager.php:105)
at Illuminate\Support\Manager->createDriver('file')
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Support/Manager.php:80)
at Illuminate\Support\Manager->driver()
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:159)
at Illuminate\Session\Middleware\StartSession->getSession(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:57)
at Illuminate\Session\Middleware\StartSession->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37)
at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67)
at Illuminate\Cookie\Middleware\EncryptCookies->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103)
at Illuminate\Pipeline\Pipeline->then(object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:719)
at Illuminate\Routing\Router->runRouteWithinStack(object(Route), object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:698)
at Illuminate\Routing\Router->runRoute(object(Request), object(Route))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:662)
at Illuminate\Routing\Router->dispatchToRoute(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:651)
at Illuminate\Routing\Router->dispatch(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:167)
at Illuminate\Foundation\Http\Kernel->{closure:Illuminate\Foundation\Http\Kernel::dispatchToRouter():164}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:128)
at Illuminate\Pipeline\Pipeline->{closure:Illuminate\Pipeline\Pipeline::prepareDestination():126}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:40)
at Illuminate\Foundation\Http\Middleware\TrimStrings->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:86)
at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/fruitcake/laravel-cors/src/HandleCors.php:38)
at Fruitcake\Cors\HandleCors->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:39)
at Illuminate\Http\Middleware\TrustProxies->handle(object(Request), object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->{closure:{closure:Illuminate\Pipeline\Pipeline::carry():142}:143}(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103)
at Illuminate\Pipeline\Pipeline->then(object(Closure))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:142)
at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request))
(/var/www/aistability.dk/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:111)
at Illuminate\Foundation\Http\Kernel->handle(object(Request))
(/var/www/aistability.dk/public_html/public/index.php:51)
|