public function getOption($options, $configVar, $headers = null, $default = null)
    {
        if (isset($options[$configVar])) {
            return $options[$configVar];
        } else {
            if (!is_array($headers)) {
                $headers = array($headers);
            }
            $headers[] = $configVar;
            foreach ($headers as $header) {
                if ($val = $this->getHeader($header)) {
                    return $val;
                }
            }
            return $default;
        }
    }
public function getOption($options, $configVar, $headers = null, $default = null)
    {
        if (isset($options[$configVar])) {
            return $options[$configVar];
        } else {
            if (!is_array($headers)) {
                $headers = array($headers);
            }
            $headers[] = $configVar;
            foreach ($headers as $header) {
                if ($val = $this->getHeader($header)) {
                    return $val;
                }
            }
            return $default;
        }
    }
public function getOption ( $ options , $ configVar , $ headers = null , $ default = null ) { if ( isset ( $ options [ $ configVar ] ) ) { return $ options [ $ configVar ] ; } else { if ( ! is_array ( $ headers ) ) { $ headers = array ( $ headers ) ; } $ headers [ ] = $ configVar ; foreach ( $ headers as $ header ) { if ( $ val = $ this -> getHeader ( $ header ) ) { return $ val ; } } return $ default ; } }
Get an item from the given options array if it exists, otherwise fetch from HTTP header
or return the given default

@param  str[] $options
@param  str $configVar Name of item to get
@param  str|str[] $headers Name of HTTP header(s)
@param  str $default Fallback value
@return str
Get an item from the given options array if it exists otherwise fetch from HTTP header or return the given default