public function ServicesContext::getServerVariable in Services 7.3
Access to $_SERVER variables.
Parameters
string $variable_name: Key of the server variable.
Return value
string Value of the server variable.
Overrides ServicesContextInterface::getServerVariable
File
- servers/
rest_server/ includes/ ServicesContext.inc, line 160
Class
Code
public function getServerVariable($variable_name) {
if (isset($this->data['server'][$variable_name])) {
return $this->data['server'][$variable_name];
}
else {
if ($variable_name == 'CONTENT_TYPE' && isset($this->data['server']['HTTP_CONTENT_TYPE'])) {
return $this->data['server']['HTTP_CONTENT_TYPE'];
}
}
}