update composer
[pharext/pharext.org] / bootstrap / session.php
1 <?php
2
3 namespace app;
4
5 require_once __DIR__."/http.php";
6
7 use Auryn\Injector;
8 use http\Env\Request;
9
10 $injector->share(Session::class)
11 ->prepare(Session::class, function(Session $session, Injector $injector) {
12 if (isset($session->current) && (!isset($session->previous) || strcmp($session->current, $session->previous))) {
13 $session->previous = $session->current;
14 $session->current = $injector->make(Request::class)->getRequestUrl();
15 }
16 $session->current = $injector->make(Request::class)->getRequestUrl();
17 });