Exemple #1
0
 /**
  * Setup a new environment instance used to fulfill the client request.
  * 
  * @param bool $selfRegister TRUE if the environment must be assigned as the currently valid one
  */
 public function __construct(array $userData = [], $selfRegister = false, $loadApplication = false)
 {
     //call the collection constructor of this own class
     parent::__construct($userData);
     //register the current environment
     if ($selfRegister) {
         self::RegisterEnvironment($this);
     }
     if ($loadApplication) {
         //load the server configuration
         $this->loadConfiguration();
     }
 }
Exemple #2
0
 /**
  * Retrieve a single derived request attribute.
  *
  * Retrieves a single derived request attribute as described in
  * getAttributes(). If the attribute has not been previously set, returns
  * the default value as provided.
  *
  * This method obviates the need for a hasAttribute() method, as it allows
  * specifying a default value to return if the attribute is not found.
  *
  * @see getAttributes()
  *
  * @param string $name    The attribute name.
  * @param mixed  $default Default value to return if the attribute does not exist.
  *
  * @return mixed
  */
 public function getAttribute($name, $default = null)
 {
     return $this->attributes->get($name, $default);
 }
Exemple #3
0
 /**
  * Remove header from collection.
  *
  * @param string $key The case-insensitive header name
  */
 public function remove($key)
 {
     parent::remove($this->normalizeKey($key));
 }