protected function cxt($name, $default = NULL) {

    // Lazilly populate the context array.
    if (is_resource($this->context) && empty($this->contextArray)) {
      $cxt = stream_context_get_options($this->context);

      // If a custom scheme name has been set, use that.
      if (!empty($cxt[$this->schemeName])) {
        $this->contextArray = $cxt[$this->schemeName];
      }
      // We fall back to this just in case.
      elseif (!empty($cxt[self::DEFAULT_SCHEME])) {
        $this->contextArray = $cxt[self::DEFAULT_SCHEME];
      }
    }

    // Should this be array_key_exists()?
    if (isset($this->contextArray[$name])) {
      return $this->contextArray[$name];
    }

    // Check to see if the value can be gotten from
    // \HPCloud\Bootstrap.
    $val = \HPCloud\Bootstrap::config($name, NULL);
    if (isset($val)) {
      return $val;
    }

    return $default;
  }
protected function cxt($name, $default = NULL) {

    // Lazilly populate the context array.
    if (is_resource($this->context) && empty($this->contextArray)) {
      $cxt = stream_context_get_options($this->context);

      // If a custom scheme name has been set, use that.
      if (!empty($cxt[$this->schemeName])) {
        $this->contextArray = $cxt[$this->schemeName];
      }
      // We fall back to this just in case.
      elseif (!empty($cxt[self::DEFAULT_SCHEME])) {
        $this->contextArray = $cxt[self::DEFAULT_SCHEME];
      }
    }

    // Should this be array_key_exists()?
    if (isset($this->contextArray[$name])) {
      return $this->contextArray[$name];
    }

    // Check to see if the value can be gotten from
    // \HPCloud\Bootstrap.
    $val = \HPCloud\Bootstrap::config($name, NULL);
    if (isset($val)) {
      return $val;
    }

    return $default;
  }
protected function cxt ( $ name , $ default = NULL ) { // Lazilly populate the context array. if ( is_resource ( $ this -> context ) && empty ( $ this -> contextArray ) ) { $ cxt = stream_context_get_options ( $ this -> context ) ; // If a custom scheme name has been set, use that. if ( ! empty ( $ cxt [ $ this -> schemeName ] ) ) { $ this -> contextArray = $ cxt [ $ this -> schemeName ] ; } // We fall back to this just in case. elseif ( ! empty ( $ cxt [ self :: DEFAULT_SCHEME ] ) ) { $ this -> contextArray = $ cxt [ self :: DEFAULT_SCHEME ] ; } } // Should this be array_key_exists()? if ( isset ( $ this -> contextArray [ $ name ] ) ) { return $ this -> contextArray [ $ name ] ; } // Check to see if the value can be gotten from // \HPCloud\Bootstrap. $ val = \ HPCloud \ Bootstrap :: config ( $ name , NULL ) ; if ( isset ( $ val ) ) { return $ val ; } return $ default ; }
Get an item out of the context.

@todo Should there be an option to NOT query the Bootstrap::conf()?

@param string $name
The name to look up. First look it up in the context, then look
it up in the Bootstrap config.
@param mixed $default
The default value to return if no config param was found.
@retval mixed
@return mixed
The discovered result, or $default if specified, or NULL if
no $default is specified.
Get an item out of the context .