class ShopwareEnvironmentProcessor implements ProcessorInterface
{ /**
* Adds request, shop and session info
*/
public function __invoke(array
$record) { if ($request =
Shopware()->
Front()->
Request()) { $record['extra'
]['request'
] =
[ 'uri' =>
$request->
getRequestUri(),
'method' =>
$request->
getMethod(),
'query' =>
$this->
filterRequestUserData($request->
getQuery()),
'post' =>
$this->
filterRequestUserData($request->
getPost()),
];
} elseif (!
empty($_SERVER['REQUEST_URI'
])) { $record['extra'
]['request'
] =
[ 'uri' =>
$_SERVER['REQUEST_URI'
],
'method' =>
$_SERVER['REQUEST_METHOD'
],
'query' =>
$this->
filterRequestUserData($_GET),
'post' =>
$this->
filterRequestUserData($_POST),
];
} else { $record['extra'
]['request'
] = 'Could not process request data';
}