本文整理汇总了PHP中Piwik_Common::getOs方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_Common::getOs方法的具体用法?PHP Piwik_Common::getOs怎么用?PHP Piwik_Common::getOs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_Common
的用法示例。
在下文中一共展示了Piwik_Common::getOs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserSettingsInformation
/**
* Gets the UserSettings information and returns them in an array of name => value
*
* @return array
*/
private function getUserSettingsInformation()
{
// we already called this method before, simply returns the result
if (is_array($this->userSettingsInformation)) {
return $this->userSettingsInformation;
}
$plugin_Flash = Piwik_Common::getRequestVar('fla', 0, 'int');
$plugin_Director = Piwik_Common::getRequestVar('dir', 0, 'int');
$plugin_Quicktime = Piwik_Common::getRequestVar('qt', 0, 'int');
$plugin_RealPlayer = Piwik_Common::getRequestVar('realp', 0, 'int');
$plugin_Pdf = Piwik_Common::getRequestVar('pdf', 0, 'int');
$plugin_WindowsMedia = Piwik_Common::getRequestVar('wma', 0, 'int');
$plugin_Java = Piwik_Common::getRequestVar('java', 0, 'int');
$plugin_Cookie = Piwik_Common::getRequestVar('cookie', 0, 'int');
$userAgent = Piwik_Common::sanitizeInputValues(@$_SERVER['HTTP_USER_AGENT']);
$aBrowserInfo = Piwik_Common::getBrowserInfo($userAgent);
$browserName = $aBrowserInfo['name'];
$browserVersion = $aBrowserInfo['version'];
$os = Piwik_Common::getOs($userAgent);
$resolution = Piwik_Common::getRequestVar('res', 'unknown', 'string');
$colorDepth = Piwik_Common::getRequestVar('col', 32, 'numeric');
$ip = Piwik_Common::getIp();
$ip = ip2long($ip);
$browserLang = substr(Piwik_Common::sanitizeInputValues(@$_SERVER['HTTP_ACCEPT_LANGUAGE']), 0, 20);
if (is_null($browserLang)) {
$browserLang = '';
}
$configurationHash = $this->getConfigHash($os, $browserName, $browserVersion, $resolution, $colorDepth, $plugin_Flash, $plugin_Director, $plugin_RealPlayer, $plugin_Pdf, $plugin_WindowsMedia, $plugin_Java, $plugin_Cookie, $ip, $browserLang);
$this->userSettingsInformation = array('config_md5config' => $configurationHash, 'config_os' => $os, 'config_browser_name' => $browserName, 'config_browser_version' => $browserVersion, 'config_resolution' => $resolution, 'config_color_depth' => $colorDepth, 'config_pdf' => $plugin_Pdf, 'config_flash' => $plugin_Flash, 'config_java' => $plugin_Java, 'config_director' => $plugin_Director, 'config_quicktime' => $plugin_Quicktime, 'config_realplayer' => $plugin_RealPlayer, 'config_windowsmedia' => $plugin_WindowsMedia, 'config_cookie' => $plugin_RealPlayer, 'location_ip' => $ip, 'location_browser_lang' => $browserLang);
return $this->userSettingsInformation;
}