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


PHP Piwik_Common::isMacOS方法代碼示例

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


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

示例1: test_php_compat_inet_pton

 function test_php_compat_inet_pton()
 {
     $adds = array('127.0.0.1' => '7f000001', '192.232.131.222' => 'c0e883de', '255.0.0.0' => 'ff000000', '255.255.255.255' => 'ffffffff', '::' => '00000000000000000000000000000000', '::0' => '00000000000000000000000000000000', '0::' => '00000000000000000000000000000000', '0::0' => '00000000000000000000000000000000', '::1' => '00000000000000000000000000000001', '2001:260:0:10::1' => '20010260000000100000000000000001', '2001:5c0:1000:b::90f8' => '200105c01000000b00000000000090f8', 'fe80::200:4cff:fe43:172f' => 'fe8000000000000002004cfffe43172f', '::ffff:127.0.0.1' => '00000000000000000000ffff7f000001', '::127.0.0.1' => '0000000000000000000000007f000001', '00000::' => '00000000000000000000000000000000', '1:2:3:4:5:ffff:127.0.0.1' => '00010002000300040005ffff7f000001', null => false, false => false, true => false, '' => false, '0' => false, '07.07.07.07' => false, '1.' => false, '.1' => false, '1.1' => false, '.1.1.' => false, '1.1.1.' => false, '.1.1.1' => false, '1.2.3.4.' => false, '.1.2.3.4' => false, '1.2.3.256' => false, 'a.b.c.d' => false, '::1::' => false, '1:2:3:4:::5:6' => false, '1:2:3:4:5:6:' => false, ':1:2:3:4:5:6' => false, '1:2:3:4:5:6:7:' => false, ':1:2:3:4:5:6:7' => false, '::11111:0' => false, '::g' => false, '::ffff:127.00.0.1' => false, '::ffff:127.0.0.01' => false, '::ffff:256.0.0.1' => false, '::ffff:1.256.0.1' => false, '::ffff:65536.0.0.1' => false, '::ffff:256.65536.0.1' => false, '::ffff:65536.65536.0.1' => false, '::ffff:7f01:0.1' => false, 'ffff:127.0.0.1:ffff::' => false);
     foreach ($adds as $k => $v) {
         $this->assertEqual(bin2hex(php_compat_inet_pton($k)), $v, $k);
         if (!Piwik_Common::isWindows() && !Piwik_Common::isMacOS()) {
             $this->assertEqual(bin2hex(@inet_pton($k)), $v, $k);
         }
     }
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:10,代碼來源:IP.test.php


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