Tablet.php 844 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace WhichBrowser\Analyser\Header\Useragent\Device;
  3. use WhichBrowser\Constants;
  4. use WhichBrowser\Data;
  5. use WhichBrowser\Model\Version;
  6. trait Tablet
  7. {
  8. private function detectTablet($ua)
  9. {
  10. $this->detectWebTab($ua);
  11. }
  12. /* WeTab */
  13. private function detectWebTab($ua)
  14. {
  15. if (preg_match('/WeTab-Browser /ui', $ua, $match)) {
  16. $this->data->device->manufacturer = 'WeTab';
  17. $this->data->device->model = 'WeTab';
  18. $this->data->device->identified |= Constants\Id::MATCH_UA;
  19. $this->data->device->type = Constants\DeviceType::TABLET;
  20. $this->data->browser->name = 'WebTab Browser';
  21. $this->data->browser->version = null;
  22. $this->data->os->name = 'MeeGo';
  23. $this->data->os->version = null;
  24. }
  25. }
  26. }