Skip to content

Commit

Permalink
Merge 3cc6f6d into da24adc
Browse files Browse the repository at this point in the history
  • Loading branch information
summercms committed Jan 12, 2021
2 parents da24adc + 3cc6f6d commit 14eb47a
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 258 deletions.
16 changes: 6 additions & 10 deletions src/Analyser/Header/Useragent/Device/Appliance.php
Expand Up @@ -12,20 +12,16 @@ private function detectAppliance($ua)
$this->detectWebLight($ua);
}





/* Netpliance i-Opener */

private function detectIOpener($ua)
{
if (preg_match('/I-Opener [0-9.]+; Netpliance/u', $ua)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'Netpliance',
'model' => 'i-Opener',
'type' => Constants\DeviceType::DESKTOP
'manufacturer' => 'Netpliance',
'model' => 'i-Opener',
'type' => Constants\DeviceType::DESKTOP
]);
}
}
Expand All @@ -37,9 +33,9 @@ private function detectWebLight($ua)
if (preg_match('/KOMATSU.*WL\//u', $ua)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'KOMATSU',
'model' => 'WebLight',
'type' => Constants\DeviceType::DESKTOP
'manufacturer' => 'KOMATSU',
'model' => 'WebLight',
'type' => Constants\DeviceType::DESKTOP
]);
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/Analyser/Header/Useragent/Device/Cars.php
Expand Up @@ -15,20 +15,16 @@ private function detectCars($ua)
$this->detectTesla($ua);
}





/* Tesla S */

private function detectTesla($ua)
{
if (preg_match('/QtCarBrowser/u', $ua)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'Tesla',
'model' => 'Model S',
'type' => Constants\DeviceType::CAR
'manufacturer' => 'Tesla',
'model' => 'Model S',
'type' => Constants\DeviceType::CAR
]);
}
}
Expand Down
53 changes: 22 additions & 31 deletions src/Analyser/Header/Useragent/Device/Ereader.php
Expand Up @@ -21,19 +21,16 @@ private function detectEreader($ua)
$this->detectIriver($ua);
}




/* Amazon Kindle */

private function detectKindle($ua)
{
if (preg_match('/Kindle/u', $ua) && !preg_match('/Fire/u', $ua)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'Amazon',
'series' => 'Kindle',
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'Amazon',
'series' => 'Kindle',
'type' => Constants\DeviceType::EREADER
]);

if (preg_match('/Kindle SkipStone/u', $ua)) {
Expand All @@ -57,52 +54,48 @@ private function detectKindle($ua)
}
}


/* Barnes & Noble Nook */

private function detectNook($ua)
{
if (preg_match('/nook browser/u', $ua)) {
$this->data->os->reset([ 'name' => 'Android' ]);
$this->data->device->setIdentification([
'manufacturer' => 'Barnes & Noble',
'series' => 'NOOK',
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'Barnes & Noble',
'series' => 'NOOK',
'type' => Constants\DeviceType::EREADER
]);
}
}


/* Bookeen */

private function detectBookeen($ua)
{
if (preg_match('/bookeen\/cybook/u', $ua)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'Bookeen',
'series' => 'Cybook',
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'Bookeen',
'series' => 'Cybook',
'type' => Constants\DeviceType::EREADER
]);
}
}


/* Kobo */

private function detectKobo($ua)
{
if (preg_match('/Kobo (eReader|Touch)/u', $ua, $match)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'Kobo',
'series' => 'eReader',
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'Kobo',
'series' => 'eReader',
'type' => Constants\DeviceType::EREADER
]);
}
}


/* Sony Reader */

private function detectSonyreader($ua)
Expand All @@ -127,15 +120,14 @@ private function detectSonyreader($ua)

$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'Sony',
'model' => $model,
'series' => 'Reader',
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'Sony',
'model' => $model,
'series' => 'Reader',
'type' => Constants\DeviceType::EREADER
]);
}
}


/* PocketBook */

private function detectPocketbook($ua)
Expand Down Expand Up @@ -187,24 +179,23 @@ private function detectPocketbook($ua)

$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'PocketBook',
'model' => $model,
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'PocketBook',
'model' => $model,
'type' => Constants\DeviceType::EREADER
]);
}
}


/* iRiver */

private function detectIriver($ua)
{
if (preg_match('/Iriver ;/u', $ua)) {
$this->data->os->reset();
$this->data->device->setIdentification([
'manufacturer' => 'iRiver',
'series' => 'Story',
'type' => Constants\DeviceType::EREADER
'manufacturer' => 'iRiver',
'series' => 'Story',
'type' => Constants\DeviceType::EREADER
]);

if (preg_match('/EB07/u', $ua)) {
Expand Down

0 comments on commit 14eb47a

Please sign in to comment.