当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::getPlugins方法代码示例

本文整理汇总了PHP中Piwik\Tracker\Request::getPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getPlugins方法的具体用法?PHP Request::getPlugins怎么用?PHP Request::getPlugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Tracker\Request的用法示例。


在下文中一共展示了Request::getPlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUserSettingsInformation

 /**
  * Gets the UserSettings information and returns them in an array of name => value
  *
  * @return array
  */
 protected function getUserSettingsInformation()
 {
     // we already called this method before, simply returns the result
     if (is_array($this->userSettingsInformation)) {
         return $this->userSettingsInformation;
     }
     require_once PIWIK_INCLUDE_PATH . '/libs/UserAgentParser/UserAgentParser.php';
     list($plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF, $plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie) = $this->request->getPlugins();
     $resolution = $this->request->getParam('res');
     $userAgent = $this->request->getUserAgent();
     $aBrowserInfo = UserAgentParser::getBrowser($userAgent);
     $browserName = $aBrowserInfo !== false && $aBrowserInfo['id'] !== false ? $aBrowserInfo['id'] : 'UNK';
     $browserVersion = $aBrowserInfo !== false && $aBrowserInfo['version'] !== false ? $aBrowserInfo['version'] : '';
     $os = UserAgentParser::getOperatingSystem($userAgent);
     $os = $os === false ? 'UNK' : $os['id'];
     $browserLang = substr($this->request->getBrowserLanguage(), 0, 20);
     // limit the length of this string to match db
     $configurationHash = $this->getConfigHash($os, $browserName, $browserVersion, $plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF, $plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie, $this->getVisitorIp(), $browserLang);
     $this->userSettingsInformation = array('config_id' => $configurationHash, 'config_os' => $os, 'config_browser_name' => $browserName, 'config_browser_version' => $browserVersion, 'config_resolution' => $resolution, '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_gears' => $plugin_Gears, 'config_silverlight' => $plugin_Silverlight, 'config_cookie' => $plugin_Cookie, 'location_browser_lang' => $browserLang);
     return $this->userSettingsInformation;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:26,代码来源:Visit.php

示例2: getConfigId

 public function getConfigId(Request $request, $ipAddress)
 {
     list($plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF, $plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie) = $request->getPlugins();
     $userAgent = $request->getUserAgent();
     $deviceDetector = DeviceDetectorFactory::getInstance($userAgent);
     $aBrowserInfo = $deviceDetector->getClient();
     if ($aBrowserInfo['type'] != 'browser') {
         // for now only track browsers
         unset($aBrowserInfo);
     }
     $browserName = !empty($aBrowserInfo['short_name']) ? $aBrowserInfo['short_name'] : 'UNK';
     $browserVersion = !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : '';
     if ($deviceDetector->isBot()) {
         $os = self::OS_BOT;
     } else {
         $os = $deviceDetector->getOS();
         $os = empty($os['short_name']) ? 'UNK' : $os['short_name'];
     }
     $browserLang = substr($request->getBrowserLanguage(), 0, 20);
     // limit the length of this string to match db
     return $this->getConfigHash($request, $os, $browserName, $browserVersion, $plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF, $plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $plugin_Cookie, $ipAddress, $browserLang);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:22,代码来源:Settings.php


注:本文中的Piwik\Tracker\Request::getPlugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。