for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Sergey Nehaenko <[email protected]>
* @license GPL
* @copyright Sergey Nehaenko © 2016
* @version 2.0
* @project browser-detector
*/
namespace EndorphinStudio\Detector;
class OS extends DataWithVersion
{
/** @var string $Family */
public $Family;
* OS constructor.
* @param \SimpleXMLElement $xmlData Xml data from file
public function __construct($xmlData)
parent::__construct($xmlData);
foreach($xmlData->children() as $child)
switch($child->getName())
case 'family':
switch($child->__toString())
case 'UNX':
$this->Family = UNX;
break;
case 'MAC':
$this->Family = MAC;
case 'WIN':
$this->Family = WIN;
}
define('UNX','unix');
define('WIN','windows');
define('MAC','mac');