当前位置: 首页>>代码示例>>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;未经允许,请勿转载。