Вход Регистрация
Файл: vendor/whichbrowser/parser/src/Analyser/Header/Puffin.php
Строк: 38
<?php

namespace WhichBrowserAnalyserHeader;

use 
WhichBrowserData;

class 
Puffin
{
    public function 
__construct($header, &$data)
    {
        
$this->data =& $data;

        
$parts explode('/'$header);

        if (
$this->data->browser->name != 'Puffin') {
            
$this->data->browser->name 'Puffin';
            
$this->data->browser->version null;
            
$this->data->browser->stock false;
        }

        
$this->data->device->type 'mobile';

        if (
count($parts) > && $parts[0] == 'Android') {
            if (!isset(
$this->data->os->name) || $this->data->os->name != 'Android') {
                
$this->data->os->name 'Android';
                
$this->data->os->version null;
            }

            
$device DataDeviceModels::identify('android'$parts[1]);
            if (
$device->identified) {
                
$device->identified |= $this->data->device->identified;
                
$this->data->device $device;
            }
        }

        if (
count($parts) > && $parts[0] == 'iPhone OS') {
            if (!isset(
$this->data->os->name) || $this->data->os->name != 'iOS') {
                
$this->data->os->name 'iOS';
                
$this->data->os->version null;
            }

            
$device DataDeviceModels::identify('ios'$parts[1]);

            if (
$device->identified) {
                
$device->identified |= $this->data->device->identified;
                
$this->data->device $device;
            }
        }
    }
}
Онлайн: 2
Реклама