/** * Rad\Authentication\Provider\BasicHttpAuthentication constructor * * @param ServerRequest $request */ public function __construct(ServerRequest $request) { if (isset($request->getServerParams()['PHP_AUTH_USER'])) { $this->identity = $request->getServerParams()['PHP_AUTH_USER']; } if (isset($request->getServerParams()['PHP_AUTH_PW'])) { $this->credential = $request->getServerParams()['PHP_AUTH_PW']; } parent::__construct($this->identity, $this->credential); }
/** * Rad\Network\Http\Request constructor */ public function __construct() { parent::__construct($_SERVER, $this->prepareUploadedFiles($_FILES), $this->prepareUri($_SERVER), isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET', 'php://input', $this->prepareHeaders($_SERVER)); $this->cookieParams = $_COOKIE; $this->queryParams = $_GET; $this->parsedBody = $this->prepareParsedBody(); if (isset($this->parsedBody['_method'])) { $this->method = strtoupper($this->parsedBody['_method']); } }