public function parse()
{
$return = array();
foreach ($this->getRegexes() as $osRegex) {
$matches = $this->matchUserAgent($osRegex['regex']);
if ($matches) {
break;
}
}
if (!$matches) {
return $return;
}
$name = $this->buildByMatch($osRegex['name'], $matches);
$short = 'UNK';
foreach (self::$operatingSystems as $osShort => $osName) {
if (strtolower($name) == strtolower($osName)) {
$name = $osName;
$short = $osShort;
}
}
$return = array('name' => $name, 'short_name' => $short, 'version' => $this->buildVersion($osRegex['version'], $matches), 'platform' => $this->parsePlatform());
if (in_array($return['name'], self::$operatingSystems)) {
$return['short_name'] = array_search($return['name'], self::$operatingSystems);
}
return $return;
}