/** * @param string $redirectURL * @param string $currentURL * @param string $message * @param SessionInterface $session */ public function __construct($redirectURL, $currentURL = null, $message = null, SessionInterface $session = null) { $this->redirectURL = $redirectURL; $this->currentURL = $currentURL; if (!$this->currentURL) { $URI = ''; $HTTPS = array_get('HTTPS', $_SERVER); if ($HTTPS && $HTTPS !== 'on' || array_get('HTTP_X_FORWARDED_PROTO', $_SERVER) === 'https') { $URI = 'https://'; } else { $URI = 'http://'; } $URI .= array_get('HTTP_HOST', $_SERVER, ''); $URI .= array_get('REQUEST_URI', $_SERVER, ''); $this->currentURL = $URI; } $this->message = $message ?: I18N::__('Please log in.', ['context' => 'elixir']); $this->session = $session ?: Session::instance(); }
/** * @param SessionInterface|\ArrayAccess|array $session */ public function __construct($session = null) { $this->session = $session ?: Session::instance(); }
/** * @param ServerRequestInterface $request * @param array|\ArrayAccess $storage */ public function __construct(ServerRequestInterface $request = null, $storage = null) { $this->request = $request ?: ServerRequestFactory::createFromGlobals(); $this->storage = $storage ?: Session::instance(); }