vendor/piwik/device-detector/Parser/Device/HbbTv.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* Device Detector - The Universal Device Detection library for parsing User Agents
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later
*/
namespace DeviceDetector\Parser\Device;
/**
* Class HbbTv
*
* Device parser for hbbtv detection
*
* @package DeviceDetector\Parser\Device
*/
class HbbTv extends DeviceParserAbstract
{
protected $fixtureFile = 'regexes/device/televisions.yml';
protected $parserName = 'tv';
/**
* Parses the current UA and checks whether it contains HbbTv information
*
* @see televisions.yml for list of detected televisions
*/
public function parse()
{
// only parse user agents containing hbbtv fragment
if (!$this->isHbbTv()) {
return false;
}
parent::parse();
// always set device type to tv, even if no model/brand could be found
$this->deviceType = self::DEVICE_TYPE_TV;
return true;
}
/**
* Returns if the parsed UA was identified as a HbbTV device
*
* @return bool
*/
public function isHbbTv()
{
$regex = 'HbbTV/([1-9]{1}(?:\.[0-9]{1}){1,2})';
$match = $this->matchUserAgent($regex);
return $match ? $match[1] : false;
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。