30 'url' =>
'REQUEST_URI',
31 'ip' =>
'REMOTE_ADDR',
32 'http_method' =>
'REQUEST_METHOD',
33 'server' =>
'SERVER_NAME',
34 'referrer' =>
'HTTP_REFERER',
48 throw new \UnexpectedValueException(
'$serverData must be an array or object implementing ArrayAccess.');
52 foreach (array_keys($this->extraFields) as $fieldName) {
54 unset($this->extraFields[$fieldName]);
68 if (!isset($this->serverData[
'REQUEST_URI'])) {
84 $this->extraFields[$extraName] = $serverName;
95 foreach ($this->extraFields as $extraName => $serverName) {
96 $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;
99 if (isset($this->serverData[
'UNIQUE_ID'])) {
100 $extra[
'unique_id'] = $this->serverData[
'UNIQUE_ID'];
__construct($serverData=null, array $extraFields=null)
addExtraField($extraName, $serverName)
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
Injects url/method and remote IP of the current web request in all records.
appendExtraFields(array $extra)