| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function fill(): void |
||
| 43 | { |
||
| 44 | $this->ip = $_SERVER['HTTP_CLIENT_IP'] ?? ($_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR']); |
||
| 45 | |||
| 46 | static $detector = NULL; |
||
| 47 | if (NULL === $detector) { |
||
| 48 | $detector = new DeviceDetector\DeviceDetector($_SERVER['HTTP_USER_AGENT']); |
||
| 49 | $detector->parse(); |
||
| 50 | } |
||
| 51 | $detector->parse(); |
||
| 52 | $this->os = sprintf( |
||
| 53 | '%s %s %s', |
||
| 54 | $detector->getOs('name'), |
||
| 55 | $detector->getOs('version'), |
||
| 56 | $detector->getOs('platform') |
||
| 57 | ); |
||
| 58 | $this->userAgent = sprintf( |
||
| 59 | '%s - %s %s, engine: %s %s', |
||
| 60 | $detector->getClient('type'), |
||
| 61 | $detector->getClient('name'), |
||
| 62 | $detector->getClient('version'), |
||
| 63 | $detector->getClient('engine'), |
||
| 64 | $detector->getClient('engine_version') |
||
| 65 | ); |
||
| 66 | } |
||
| 67 | |||
| 92 |