當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik_Common::getIp方法代碼示例

本文整理匯總了PHP中Piwik_Common::getIp方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik_Common::getIp方法的具體用法?PHP Piwik_Common::getIp怎麽用?PHP Piwik_Common::getIp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik_Common的用法示例。


在下文中一共展示了Piwik_Common::getIp方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct()
 {
     $logToFileFilename = self::ID;
     $logToDatabaseTableName = self::ID;
     $logToDatabaseColumnMapping = null;
     $screenFormatter = new Piwik_Log_APICall_Formatter_ScreenFormatter();
     $fileFormatter = new Piwik_Log_Formatter_FileFormatter();
     parent::__construct($logToFileFilename, $fileFormatter, $screenFormatter, $logToDatabaseTableName, $logToDatabaseColumnMapping);
     $this->setEventItem('caller_ip', Piwik_Common::getIp());
 }
開發者ID:klando,項目名稱:pgpiwik,代碼行數:10,代碼來源:APICall.php

示例2: __construct

 public function __construct($forcedIpString = null, $forcedDateTime = null)
 {
     $this->timestamp = time();
     if (!empty($forcedDateTime)) {
         if (!is_int($forcedDateTime)) {
             $forcedDateTime = strtotime($forcedDateTime);
         }
         $this->timestamp = $forcedDateTime;
     }
     $ipString = $forcedIpString;
     if (empty($ipString)) {
         $ipString = Piwik_Common::getIpString();
     }
     $this->ipString = Piwik_Common::getIp($ipString);
 }
開發者ID:Gninety,項目名稱:Microweber,代碼行數:15,代碼來源:Visit.php

示例3: 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';
     $plugin_Flash = Piwik_Common::getRequestVar('fla', 0, 'int', $this->request);
     $plugin_Java = Piwik_Common::getRequestVar('java', 0, 'int', $this->request);
     $plugin_Director = Piwik_Common::getRequestVar('dir', 0, 'int', $this->request);
     $plugin_Quicktime = Piwik_Common::getRequestVar('qt', 0, 'int', $this->request);
     $plugin_RealPlayer = Piwik_Common::getRequestVar('realp', 0, 'int', $this->request);
     $plugin_PDF = Piwik_Common::getRequestVar('pdf', 0, 'int', $this->request);
     $plugin_WindowsMedia = Piwik_Common::getRequestVar('wma', 0, 'int', $this->request);
     $plugin_Gears = Piwik_Common::getRequestVar('gears', 0, 'int', $this->request);
     $plugin_Silverlight = Piwik_Common::getRequestVar('ag', 0, 'int', $this->request);
     $plugin_Cookie = Piwik_Common::getRequestVar('cookie', 0, 'int', $this->request);
     $userAgent = Piwik_Common::sanitizeInputValues(@$_SERVER['HTTP_USER_AGENT']);
     $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'];
     $resolution = Piwik_Common::getRequestVar('res', 'unknown', 'string', $this->request);
     $ip = Piwik_Common::getIp();
     $browserLang = Piwik_Common::getBrowserLanguage();
     $configurationHash = $this->getConfigHash($os, $browserName, $browserVersion, $resolution, $plugin_Flash, $plugin_Java, $plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF, $plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $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_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_ip' => $ip, 'location_browser_lang' => $browserLang);
     return $this->userSettingsInformation;
 }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:35,代碼來源:Visit.php

示例4: getVisitorIp

 /**
  * Returns the visitor's IP address
  *
  * @return long
  */
 protected function getVisitorIp()
 {
     return Piwik_Common::getIp();
 }
開發者ID:ntulip,項目名稱:piwik,代碼行數:9,代碼來源:Visit.php

示例5: 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 "UserAgentParser/UserAgentParser.php";
     $plugin_Flash = Piwik_Common::getRequestVar('fla', 0, 'int', $this->request);
     $plugin_Director = Piwik_Common::getRequestVar('dir', 0, 'int', $this->request);
     $plugin_RealPlayer = Piwik_Common::getRequestVar('realp', 0, 'int', $this->request);
     $plugin_Pdf = Piwik_Common::getRequestVar('pdf', 0, 'int', $this->request);
     $plugin_WindowsMedia = Piwik_Common::getRequestVar('wma', 0, 'int', $this->request);
     $plugin_Cookie = Piwik_Common::getRequestVar('cookie', 0, 'int', $this->request);
     $userAgent = Piwik_Common::sanitizeInputValues(@$_SERVER['HTTP_USER_AGENT']);
     $aBrowserInfo = UserAgentParser::getBrowser($userAgent);
     # the !==false does not match the NULL and we have NOT NULL in the colums, so change to !empty.
     $browserName = !empty($aBrowserInfo) && !empty($aBrowserInfo['id']) ? $aBrowserInfo['id'] : 'UNK';
     $browserVersion = !empty($aBrowserInfo) && !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : '';
     $os = UserAgentParser::getOperatingSystem($userAgent);
     $os = $os === false ? 'UNK' : $os['id'];
     $resolution = Piwik_Common::getRequestVar('res', 'unknown', 'string', $this->request);
     $ip = Piwik_Common::getIp();
     $browserLang = Piwik_Common::getBrowserLanguage();
     $configurationHash = $this->getConfigHash($os, $browserName, $browserVersion, $resolution, $plugin_Flash, $plugin_Director, $plugin_RealPlayer, $plugin_Pdf, $plugin_WindowsMedia, $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_pdf' => $plugin_Pdf, 'config_flash' => $plugin_Flash, 'config_director' => $plugin_Director, 'config_realplayer' => $plugin_RealPlayer, 'config_windowsmedia' => $plugin_WindowsMedia, 'config_cookie' => $plugin_Cookie, 'location_ip' => $ip, 'location_browser_lang' => $browserLang);
     return $this->userSettingsInformation;
 }
開發者ID:klando,項目名稱:pgpiwik,代碼行數:32,代碼來源:Visit.php

示例6: 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;
 }
開發者ID:Doluci,項目名稱:tomatocart,代碼行數:36,代碼來源:Visit.php


注:本文中的Piwik_Common::getIp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。