I want to use the php device detector , which is part of the famous Piwik project, but I cannot figure out how to enable and use the code in my php code? I do not want to use a composer.
I wrote:
<?php include 'DeviceDetector.php'; use DeviceDetector\DeviceDetector; use DeviceDetector\Parser\Device\DeviceParserAbstract; $dd = new DeviceDetector($_SERVER['HTTP_USER_AGENT']); $dd->parse(); $clientInfo = $dd->getClient(); var_dump($clientInfo);
But that will not work. I get this error:
Fatal error: Uncaught exception 'Exception' with message 'client parser not found' in D:\DeviceDetector.php:214 Stack trace: #0 D:\DeviceDetector.php(136): DeviceDetector\DeviceDetector->addClientParser('FeedReader') #1 D:\index.php(67): DeviceDetector\DeviceDetector->__construct('Mozilla/5.0 (Wi...') #2 {main} thrown in D:\DeviceDetector.php on line 214
source share