7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
9 * @package Magic3 Framework
10 * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11 * @copyright Copyright 2006-2016 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
14 * @link http://www.magic3.org
16 require_once(M3_SYSTEM_INCLUDE_PATH . '/common/core.php');
17 require_once(M3_SYSTEM_INCLUDE_PATH . '/db/analyticsDb.php');
19 class AnalyzeManager extends Core
21 private $db; // DBオブジェクト
23 const NOT_FOUND_BROWSER_IMAGE = 'noimage.png'; // ブラウザアイコンが見つからなかった場合のアイコン
24 const CF_LAST_DATE_CALC_PV = 'last_date_calc_pv'; // ページビュー集計の最終更新日
25 const MAX_CALC_DAYS = 30; // 最大集計日数
26 // const CRAWLER_DETECT_SCRIPT_DIR = '/Crawler-Detect-1.2.2/'; // クローラー解析スクリプトディレクトリ
27 const CRAWLER_DETECT_SCRIPT_DIR = '/Crawler-Detect-1.2.20/'; // クローラー解析スクリプトディレクトリ
28 const USER_AGENT_SCRIPT = '/Net_UserAgent_Mobile-1.0.0/Net/UserAgent/Mobile.php'; // ユーザエージェント解析用スクリプト
29 const BROWSER_DETECT_SCRIPT = '/PhpUserAgent-0.5.2/UserAgentParser.php'; // ブラウザ判定スクリプト
30 const PLATFORM_DETECT_SCRIPT_DIR = '/php-browser-detector-6.0.5/'; // プラットフォーム判定スクリプト
35 function __construct()
38 parent::__construct();
41 $this->db = $this->gInstance->getSytemDbObject();
42 $this->analyticsDb = new analyticsDb();
47 * @param string $typeId コンテンツタイプ
48 * @param int $serial コンテンツシリアル番号(0のときはコンテンツIDを使用)
49 * @param string $day 日にち
51 * @param string $contentId コンテンツID
52 * @return bool true=成功, false=失敗
54 function updateContentViewCount($typeId, $serial, $day = null, $hour = null, $contentId = '')
56 $ret = $this->db->updateViewCount($typeId, $serial, $contentId, $day, $hour);
62 * @param string $typeId コンテンツタイプ
63 * @param int $serial コンテンツシリアル番号(0のときはコンテンツIDを使用)
64 * @param string $contentId コンテンツID
67 function getTotalContentViewCount($typeId, $serial, $contentId = '')
69 $count = $this->db->getTotalViewCount($typeId, $serial, $contentId);
75 * @param string $typeId コンテンツタイプ
76 * @param int $serial コンテンツシリアル番号
77 * @param string $contentId コンテンツID
78 * @return bool true=記録、false=記録しない
80 function logContentView($typeId, $serial, $contentId = '')
86 $serial = intval($serial);
87 if ($serial <= 0) return false;
90 if (!$this->canRegistContentView()) return false;
92 if (!isset($day)) $day = date("Y/m/d"); // 日
93 if (!isset($hour)) $hour = (int)date("H"); // 時間
95 $ret = $this->db->updateViewCount($typeId, $serial, $contentId, $day, $hour);
101 * @param string $widgetId ウィジェットID
102 * @param string $keyword 検索キーワード
103 * @return bool true=記録、false=記録しない
105 function logSearchWord($widgetId, $keyword)
108 if (empty($keyword)) return false;
111 $deviceType = 0; // 端末をPCに初期化
112 if ($this->gEnv->isMobile()){ // 携帯のとき
118 switch ($deviceType){
122 $cid = $this->gAccess->getClientId();// クッキー値のクライアントID
125 $cid = $this->gEnv->getMobileId(); // 携帯端末ID
130 // 全角英数を半角に、半角カナ全角ひらがなを全角カナに変換
131 $basicWord = $keyword;
132 if (function_exists('mb_convert_kana')) $basicWord = mb_convert_kana($basicWord, 'aKCV');
133 $basicWord = strtolower($basicWord); // 大文字を小文字に変換
136 $path = $this->gEnv->getAccessPath();
139 $this->db->writeSearchWordLog($deviceType, $cid, $widgetId, $keyword, $basicWord, $path);
145 * @param string $contentType コンテンツタイプ
146 * @param string $contentId コンテンツID
147 * @return bool true=記録、false=記録しない
149 function logContentDownload($contentType, $contentId)
152 $ret = $this->db->writeDownloadLog($contentType, $contentId);
158 * (注意)クローラーがシュミレートしている場合はクローラーと判定する
160 * @param string $agent 解析元の文字列。HTTP_USER_AGENTの値。
161 * @return array ブラウザ情報
163 public function getBrowserType($agent)
166 //$agent = 'DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)'; // google 携帯シュミレート
167 $agent = 'Mozilla/5.0 (compatible; Steeler/3.5; http://www.tkl.iis.u-tokyo.ac.jp/~crawler/)'; // クローラー
169 //$agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)';
170 $agent = 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko';
171 $agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393'; // edge
172 $agent = 'Mozilla/5.0 (iPad; CPU OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1'; // ipad
173 $agent = 'Mozilla/5.0 (Linux; U; Android 1.6; ja-jp; Docomo HT-03A Build/DRD08) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1'; // android
174 $agent = 'SoftBank/1.0/831SH/SHJ003/SN123456789012345 Browser/NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1'; // SoftBank携帯
176 $agent = 'Mozilla/5.0 (PlayStation Vita 3.01) AppleWebKit/536.26 (KHTML, like Gecko) Silk/3.2';
177 $agent = 'SAMSUNG-GT-C3303/C3303DDJG4 NetFront/3.5 Profile/MIDP-2.0 Configuration/CLDC-1.1';
178 //$agent = 'Mozilla/5.0 (Linux; U; Android 4.0.3; ja-jp; SC-02C Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'; // Android標準
179 //$agent = 'Mozilla/5.0 (Linux; Android 4.0.3; SC-02C Build/IML74K) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.58 Mobile Safari/537.31'; // Android Chrome
180 $agent = 'Mozilla/4.0 (PS2; PlayStation BB Navigator 1.0) NetFront/3.0';
181 $agent = 'Opera/9.80 (Android; Opera Mini/6.5.27452/27.1324; U; ja) Presto/2.8.119 Version/11.10';
182 $agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.122 Safari/537.36 Vivaldi/1.4.589.29'; // Vivaldi
183 $agent = 'Mozilla/5.0 (PlayStation 4 1.70) AppleWebKit/536.26 (KHTML, like Gecko)'; // Playstation4
184 $agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36';
185 $agent = 'Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 1320) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537'; // Windows Phone(new) -> NG
186 $agent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; FujitsuToshibaMobileCommun; IS12T; KDDI)'; // Windows Phone(old)
187 $agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 OPR/42.0.2393.94'; // Opera Next
188 // ***** 検出失敗(2016/10/19) *****
189 $agent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 10.0; WOW64; Trident/7.0; Sleipnir6/6.2.1; SleipnirSiteUpdates/6.2.1)'; // Sleipnir RSS取得用
190 $agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 Sleipnir/6.2.1'; // Sleipnir
192 $resultObj = array();
195 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'CrawlerDetect.php');
196 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/AbstractProvider.php');
197 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/Crawlers.php');
198 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/Exclusions.php');
199 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/Headers.php');
201 $crawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect;
202 if ($crawlerDetect->isCrawler($agent)){ // クローラー検出の場合
203 $crawlerName = $crawlerDetect->getMatches();
204 $resultObj['name'] = strval($crawlerName);
205 $resultObj['browser'] = strtolower($crawlerName);
206 // $resultObj['version'] = strtolower($infoObj['version']);
207 $crawlerIcon = $this->_getBrowserIconFile($resultObj['browser']);
208 if (empty($crawlerIcon)) $crawlerIcon = $this->_getBrowserIconFile('crawler'); // クローラーデフォルトアイコン
209 $resultObj['icon'] = $crawlerIcon;
212 require_once(M3_SYSTEM_LIB_PATH . self::USER_AGENT_SCRIPT);
214 $parser = Net_UserAgent_Mobile::singleton($agent);
216 if ($parser->isNonMobile()){ // 携帯以外のとき
218 require_once(M3_SYSTEM_LIB_PATH . self::BROWSER_DETECT_SCRIPT);
220 $infoObj = parse_user_agent($agent);
221 $resultObj['name'] = strval($infoObj['browser']);
222 $resultObj['platform'] = strtolower($infoObj['platform']);
223 $resultObj['browser'] = strtolower($infoObj['browser']);
224 $resultObj['version'] = strtolower($infoObj['version']);
225 $resultObj['icon'] = $this->_getBrowserIconFile($resultObj['browser']);
226 if (empty($resultObj['icon'])) $resultObj['icon'] = self::NOT_FOUND_BROWSER_IMAGE; // ブラウザアイコンが見つからなかった場合
228 require_once(M3_SYSTEM_LIB_PATH . '/UserAgentParser.php');
229 $retObj = UserAgentParser::getBrowser($agent);
230 // if ($retObj === false){
233 // $version = $retObj['version'];
234 // return $retObj['id'];
237 } else { // 携帯(ガラケー)のとき
238 if ($parser->isDoCoMo()){ // ドコモ端末のとき
239 $resultObj['name'] = 'DoCoMo';
240 $resultObj['icon'] = $this->_getBrowserIconFile('docomo');
241 } else if ($parser->isEZweb()){ // au端末のとき
242 $resultObj['name'] = 'au';
243 $resultObj['icon'] = $this->_getBrowserIconFile('au');
244 } else if ($parser->isSoftBank()){ // ソフトバンク端末のとき
245 $resultObj['name'] = 'SoftBank';
246 $resultObj['icon'] = $this->_getBrowserIconFile('softbank');
247 } else if ($parser->isWillcom()){ // WILLCOM端末のとき
248 $resultObj['name'] = 'WILLCOM';
249 $resultObj['icon'] = $this->_getBrowserIconFile('willcom');
256 * プラットフォーム(OSまたは携帯機種)のタイプを取得
258 * @param string $agent 解析元の文字列。HTTP_USER_AGENTの値。
259 * @return array プラットフォーム情報
261 public function getPlatformType($agent)
263 /* require_once(M3_SYSTEM_LIB_PATH . self::USER_AGENT_SCRIPT);
264 $parser = Net_UserAgent_Mobile::singleton($agent);
266 if ($parser->isNonMobile()){ // 携帯以外のとき
267 require_once(M3_SYSTEM_LIB_PATH . '/UserAgentParser.php');
268 $retObj = UserAgentParser::getOperatingSystem($agent);
269 if ($retObj === false){
272 return $retObj['id'];
275 return $parser->getModel(); // 機種を取得
277 $resultObj = array();
279 require_once(M3_SYSTEM_LIB_PATH . self::PLATFORM_DETECT_SCRIPT_DIR . 'DetectorInterface.php');
280 require_once(M3_SYSTEM_LIB_PATH . self::PLATFORM_DETECT_SCRIPT_DIR . 'BrowserDetector.php');
281 require_once(M3_SYSTEM_LIB_PATH . self::PLATFORM_DETECT_SCRIPT_DIR . 'UserAgent.php');
282 require_once(M3_SYSTEM_LIB_PATH . self::PLATFORM_DETECT_SCRIPT_DIR . 'OsDetector.php');
283 require_once(M3_SYSTEM_LIB_PATH . self::PLATFORM_DETECT_SCRIPT_DIR . 'Os.php');
285 $osInfo = new Sinergi\BrowserDetector\Os($agent);
286 $resultObj['name'] = strval($osInfo->getName());
287 $resultObj['platform'] = strtolower($resultObj['name']);
288 $resultObj['version_name'] = strval($osInfo->getVersion());
289 $resultObj['version'] = strtolower($resultObj['version_name']);
290 $resultObj['icon'] = $this->_getOsIconFile($resultObj['platform']);
296 * @param string $lang 解析元の文字列。HTTP_ACCEPT_LANGUAGEの値
297 * @return string 国コード
299 public function getBrowserCountryCode($lang)
301 $lang = $this->parseBrowserLanguage($lang);
302 $tmpLang = explode(',', $lang);
303 return $this->getCountryCodeFromBrowserLanguage($tmpLang[0]);
308 * @param string $lang 解析元の文字列。HTTP_ACCEPT_LANGUAGEの値 例)ja,en-us;q=0.7,en;q=0.3
309 * @return string 言語(カンマ区切り) 例)ja,en-us,en
311 public function parseBrowserLanguage($lang)
313 $replacementPatterns = array(
314 '/(\\\\.)/', // quoted-pairs (RFC 3282)
315 '/(\s+)/', // CFWS white space
316 '/(\([^)]*\))/', // CFWS comments
317 '/(;q=[0-9.]+)/' // quality
320 $browserLang = strtolower(trim($lang));
322 // language tags are case-insensitive per HTTP/1.1 s3.10 but the region may be capitalized per ISO3166-1;
323 // underscores are not permitted per RFC 4646 or 4647 (which obsolete RFC 1766 and 3066),
324 // but we guard against a bad user agent which naively uses its locale
325 $browserLang = strtolower(str_replace('_', '-', $browserLang));
328 $browserLang = preg_replace($replacementPatterns, '', $browserLang);
330 $browserLang = preg_replace('/((^|,)chrome:.*)/', '', $browserLang, 1); // Firefox bug
331 $browserLang = preg_replace('/(,)(?:en-securid,)|(?:(^|,)en-securid(,|$))/', '\\1', $browserLang, 1); // unregistered language tag
333 $browserLang = str_replace('sr-sp', 'sr-rs', $browserLang); // unofficial (proposed) code in the wild
339 * @param string $lang 解析元の文字列。HTTP_ACCEPT_LANGUAGEの値
340 * @return string 国コード
342 public function getCountryCodeFromBrowserLanguage($browserLanguage)
344 global $COUNTRY_LIST, $LANGUAGE_TO_COUNTRY;
346 require_once(M3_SYSTEM_INCLUDE_PATH . '/data/analyzeMap.php');// アクセス解析用マップ情報
347 $validCountries = array_keys($COUNTRY_LIST);
348 $langToCountry = array_keys($LANGUAGE_TO_COUNTRY);
350 if (preg_match('/^([a-z]{2,3})(?:,|;|$)/', $browserLanguage, $matches)){
351 // match language (without region) to infer the country of origin
352 if(in_array($matches[1], $langToCountry)) return $LANGUAGE_TO_COUNTRY[$matches[1]];
354 if (!empty($validCountries) && preg_match_all("/[-]([a-z]{2})/", $browserLanguage, $matches, PREG_SET_ORDER)){
355 foreach($matches as $parts){
356 // match location; we don't make any inferences from the language
357 if(in_array($parts[1], $validCountries)) return $parts[1];
363 * アクセスログからアクセス解析用のデータを作成
365 * @param array $message エラーメッセージ
366 * @param int $maxDay 最大集計日数
367 * @return bool true=正常終了、false=異常終了
369 function updateAnalyticsData(&$message = null, $maxDay = self::MAX_CALC_DAYS)
371 $ret = $this->analyticsDb->getOldAccessLog($row);
372 if ($ret){ // 集計対象のデータが存在するとき
373 $startDate = date("Y/m/d", strtotime($row['al_dt']));
374 $lastDate = $this->analyticsDb->getStatus(self::CF_LAST_DATE_CALC_PV);
377 if (!empty($lastDate)){
378 $startDate = date("Y/m/d", strtotime("$lastDate 1 day")); // 翌日
381 $endDate = date("Y/m/d", strtotime("-1 day")); // 前日
382 $endTime = strtotime($endDate);
385 $dayCount = 0; // 集計日数
388 if (strtotime($date) > $endTime){
389 if (!is_null($message)) $message[] = '集計完了しました';
393 $this->analyticsDb->startTransaction();
395 $ret = $this->analyticsDb->calcDatePv($date);
398 if ($ret) $ret = $this->analyticsDb->updateStatus(self::CF_LAST_DATE_CALC_PV, $date);
401 $this->analyticsDb->endTransaction();
405 if (!is_null($message)) $message[] = 'エラーが発生しました';
411 if ($dayCount >= $maxDay){
412 if (!is_null($message)) $message[] = $maxDay . '日分の集計完了しました';
416 $date = date("Y/m/d", strtotime("$date 1 day"));
418 } else { // 集計データがないとき
419 if (!is_null($message)) $message[] = '集計対象のアクセスログがありません';
428 * @param int $logSerial アクセスログシリアル番号
429 * @param string $cookieValue アクセス管理用クッキー値
430 * @return bool true=成功、false=失敗
432 function realtimeAnalytics($logSerial, $cookieValue)
434 global $gRequestManager;
435 // global $gEnvManager;
437 $uri = $gRequestManager->trimServerValueOf('REQUEST_URI');
438 $referer = $gRequestManager->trimServerValueOf('HTTP_REFERER');
439 $agent = $gRequestManager->trimServerValueOf('HTTP_USER_AGENT'); // ユーザエージェント
440 $language = $gRequestManager->trimServerValueOf('HTTP_ACCEPT_LANGUAGE'); // クライアント認識可能言語
442 // 最初のアクセスかどうか確認(アクセス管理用クッキー値が存在するかどうか)
443 $isFirstAccess = false; // 最初のアクセスかどうか
444 $ret = $this->analyticsDb->isExistsCookieValueInAccessLog($cookieValue, $logSerial);
445 if (!$ret) $isFirstAccess = true;
448 /* $isCrawler = false;
449 if (empty($agent)){ // ユーザエージェントが設定されていないものはクローラーと見なす
452 $crawlerArray = array('bot', 'crawl');
453 foreach ($crawlerArray as $value){
454 if (preg_match('/' . preg_quote($value, '/') . '/i', $agent)){
460 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'CrawlerDetect.php');
461 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/AbstractProvider.php');
462 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/Crawlers.php');
463 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/Exclusions.php');
464 require_once(M3_SYSTEM_LIB_PATH . self::CRAWLER_DETECT_SCRIPT_DIR . 'Fixtures/Headers.php');
466 $crawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect;
468 if ($crawlerDetect->isCrawler()) $isCrawler = true;
471 $ret = $this->analyticsDb->updateAccessLog($logSerial, $isFirstAccess, $isCrawler);
476 * コンテンツのアクセスログを記録するかどうかを取得
478 * @return bool true=記録する、false=記録しない
480 public function canRegistContentView()
482 global $gRequestManager;
486 if (!isset($canRegist)){
487 if (!$this->gEnv->isSystemManageUser() && // システム運用者以上の場合はカウントしない
488 !$gRequestManager->isCmdAccess()){ // cmd付きアクセスでない
499 * @param string $type ブラウザ種別
500 * @return string ファイル名(該当なしの場合は空文字列)
502 public function _getBrowserIconFile($type)
505 static $browserIconFile = array(
506 'opera' => 'opera.png',
507 'opera next' => 'operanext.png',
508 'silk' => 'silk.png',
510 'microsoft internet explorer' => 'ie.png',
511 'internet explorer' => 'ie.png',
512 'edge' => 'edge.png',
513 'android browser' => 'android.png',
514 'netscape6' => 'netscape.png',
515 'netscape' => 'netscape.png',
516 'netfront' => 'netfront.gif',
517 'galeon' => 'galeon.png',
518 'phoenix' => 'phoenix.png',
519 'firefox' => 'firefox.png',
520 'mozilla firebird' => 'firebird.png',
521 'firebird' => 'firebird.png',
522 'seamonkey' => 'seamonkey.png',
523 'camino' => 'camino.png',
524 'safari' => 'safari.png',
525 'chrome' => 'chrome.gif',
526 'k-meleon' => 'k-meleon.png',
527 'mozilla' => 'mozilla.gif',
528 'konqueror' => 'konqueror.png',
530 'icab' => 'icab.png',
535 'omniweb' => 'omniweb.png',
538 'amigavoyager' => '',
542 'epiphany' => 'epiphany.png',
543 'flock' => 'flock.png',
544 'sleipnir' => 'sleipnir.gif',
545 'lunascape' => 'lunascape.gif',
546 'shiira' => 'shiira.gif',
547 'swift' => 'swift.png',
549 'playstation portable' => 'playstation.gif',
550 'scej psp browser' => '', // ワイプアウトピュア
552 'netcaptor' => 'netcaptor.gif',
553 'webtv' => 'webtv.gif',
554 'vivaldi' => 'vivaldi.png',
558 'pockey' => '', // GetHTMLW
562 'download ninja' => '', // ダウンロードNinja
568 'simplepie' => 'simplepie.png',
571 'googlebot' => 'google.gif', // Google
572 'googlebot-mobile' => 'google.gif', // Google-Mobile
573 'mediapartners-google' => 'google.gif', // Google
574 'msnbot' => 'msn.gif', // MSN
575 'msnbot-media' => 'msn.gif', // MSN
576 'yahooseeker' => 'yahoo.gif', // YahooSeeker
577 'yahoo! de slurp' => 'yahoo.gif', // Yahoo!
578 'yahoo! slurp' => 'yahoo.gif', // Yahoo!
579 'zyborg' => '', // InfoSeek
580 'infoseek' => '', // InfoSeek
581 'slurp.so/goo; slurp' => 'goo.gif', // goo
582 'mogimogi' => 'goo.gif', // goo
583 'moget' => 'goo.gif', // goo
584 'ichiro' => 'goo.gif', // goo
585 'baiduspider' => 'baidu.png', // 百度
586 'baiduspider+' => 'baidu.png', // 百度
587 'sogou web spider' => '', // 搜狗
588 'asahina-antenna' => '', // 朝日奈アンテナ
589 'hatena antenna' => 'hatena.gif', // はてなアンテナ
590 'yeti' => 'naver.gif', // Naver(韓国)
591 'icc-crawler' => 'nict.gif', // 独立行政法人情報通信研究機構
592 'dotbot' => 'dotbot.gif', // Dotbot
593 'speedy spider' => 'entireweb.png', // Entireweb
594 'turnitinbot' => 'turnitinbot.png', // TurnitinBot
595 'bingbot' => 'bing.png', // Bing
596 'yacybot' => 'yacy.png', // YaCy
597 'mj12bot' => 'mj12bot.png',
598 'ahrefsbot' => 'ahrefs.png',
599 'semrushbot' => 'semrush.png',
600 'scrapy' => 'scrapy.png',
603 'msproxy' => '', // ProxyServer
604 'spacebison' => '', // Proxomitron
605 'bookmark renewal' => '', // Bookまーく
606 'hatenascreenshot' => '', // はてなスクリーンショット
608 'crawler' => 'crawler.png', // クローラー該当なしの場合
611 'docomo' => 'docomo.gif', // ドコモ
612 'au' => 'au.gif', // au
613 'softbank' => 'softbank.gif', // ソフトバンク
614 'willcom' => 'willcom.gif', // WILLCOM
616 $filename = $browserIconFile[$type];
617 if (!isset($filename)) $filename = '';
623 * @param string $type OS種別
624 * @return string ファイル名(該当なしの場合は空文字列)
626 public function _getOsIconFile($type)
629 static $osIconFile = array(
630 /* 'IPD' => '', // iPod
631 'IPH' => '', // iPhone
632 'WII' => '', // Nintendo Wii
633 'PSP' => '', // PlayStation Portable
634 'PS3' => '', // PlayStation 3
635 'AND' => '', // Android
636 'POS' => '', // PalmOS
637 'BLB' => '', // BlackBerry
638 'WI7' => 'winvista.gif', // Windows NT 6.1, Windows 7
639 'WVI' => 'winvista.gif', // Windows NT 6.0, Windows Vista
640 'WS3' => 'win.gif', // Windows NT 5.2, Windows Server 2003
641 'WXP' => 'win.gif', // Windows NT 5.1, Windows XP
642 'W98' => 'win98.gif', // Windows 98
643 'W2K' => 'win.gif', // Windows NT 5.0, Windows 2000
644 'WNT' => 'win98.gif', // Windows NT 4.0
645 'WME' => 'win98.gif', // Win 9x 4.90, Windows ME
646 'W95' => 'win98.gif', // Windows 95
647 'MAC' => '', // Mac PowerPC
648 'LIN' => '', // Linux
650 'windows' => 'windows.png',
651 'windows phone' => 'windowsphone.gif',
654 'android' => 'android.png',
655 'chrome os' => 'chromeos.gif',
656 'linux' => 'linux.gif',
660 'freebsd' => 'bsd.gif',
661 'openbsd' => 'openbsd.gif',
662 'netbsd' => 'bsd.gif',
664 'sunos' => 'sun.gif',
668 $filename = $osIconFile[$type];
669 if (!isset($filename)) $filename = '';