Bluz\Proxy\Request::getServer PHP Method

getServer() public static method

If no $key is passed, returns the entire $_SERVER array.
public static getServer ( string $key = null, string $default = null ) : string
$key string
$default string Default value to use if key not found
return string Returns null if key does not exist
    public static function getServer($key = null, $default = null)
    {
        return RequestFactory::get($key, self::getInstance()->getServerParams(), $default);
    }

Usage Example

Example #1
0
 /**
  * Return identity if user agent is correct
  * @api
  * @return EntityInterface|null
  */
 public function getIdentity()
 {
     if (!$this->identity) {
         // check user agent
         if (Session::get('auth:agent') == Request::getServer('HTTP_USER_AGENT')) {
             $this->identity = Session::get('auth:identity');
         } else {
             $this->clearIdentity();
         }
     }
     return $this->identity;
 }
All Usage Examples Of Bluz\Proxy\Request::getServer