PATH:
home
/
sparklp6
/
public_html
/
website_356c8563
/
nitropack
/
nitropack-sdk
/
NitroPack
/
SDK
<?php namespace NitroPack\SDK; class Device { private $userAgent; public static function getKnownTypes() { return array(DeviceType::MOBILE, DeviceType::TABLET, DeviceType::DESKTOP); } public function __construct($userAgent = "") { $this->userAgent = $userAgent; } public function getUserAgent() { return $this->userAgent; } public function isDesktop() { return !($this->isMobile() && $this->isTablet()); } public function isMobile() { if (empty($this->userAgent)) return false; $mobile_agents = array('iPod','iPhone','MobileSafari','webOS','BlackBerry','windows phone','symbian','vodafone','opera mini','windows ce','smartphone','palm','midp'); foreach($mobile_agents as $mobile_agent){ if(stripos($this->userAgent, $mobile_agent)) { return true; } } if(stripos($this->userAgent, "Android") && stripos($this->userAgent, "mobile")) { return true; } return false; } public function isTablet() { if (empty($this->userAgent)) return false; $tablet_agents = array('iPad','RIM Tablet','hp-tablet','Kindle Fire','Android'); foreach($tablet_agents as $tablet_agent){ if(stripos($this->userAgent, $tablet_agent)) { return true; } } if(stripos($this->userAgent, "Android") && stripos($this->userAgent, "mobile")) { return true; } return false; } public function getType() { if ($this->isMobile()) return DeviceType::MOBILE; if ($this->isTablet()) return DeviceType::TABLET; return DeviceType::DESKTOP; } }
[-] Filesystem.php
[edit]
[-] ServiceDownException.php
[edit]
[-] HealthStatus.php
[edit]
[-] ConfigFetcherException.php
[edit]
[+]
Url
[-] .htaccess
[edit]
[-] EmptyConfigException.php
[edit]
[-] FileHandle.php
[edit]
[+]
Utils
[-] BacklogReplayTimeoutException.php
[edit]
[+]
Integrations
[+]
Api
[-] ChallengeProcessingException.php
[edit]
[-] Website.php
[edit]
[-] Backlog.php
[edit]
[-] ChallengeVerificationException.php
[edit]
[-] ExcludeEntry.php
[edit]
[-] Pagecache.php
[edit]
[-] IntegrationUrl.php
[edit]
[-] NoConfigException.php
[edit]
[-] Crypto.php
[edit]
[-] NitroPack.php
[edit]
[-] StorageException.php
[edit]
[-] VariationCookieException.php
[edit]
[-] ExcludeOperationType.php
[edit]
[-] DeviceType.php
[edit]
[-] Api.php
[edit]
[-] ElementRevision.php
[edit]
[-] Device.php
[edit]
[+]
..
[-] PurgeType.php
[edit]
[+]
StorageDriver
[-] WebhookException.php
[edit]