예제 #1
0
 function getValue()
 {
     lmb_require('limb/net/src/lmbIp.class.php');
     if ($this->isConstant()) {
         return lmbIp::decode($this->base->getValue());
     } else {
         $this->raiseUnresolvedBindingError();
     }
 }
예제 #2
0
 function testEncodeIpRangeUnsignedString()
 {
     $ip_list = lmbIp::encodeIpRange('192.168.0.1', '192.168.10.10', lmbIp::USTRING);
     $this->assertEqual(pow(256, 1) * 10 + pow(256, 0) * 10 - (pow(256, 1) * 0 + pow(256, 0) * 1) + 1, sizeof($ip_list));
     $this->assertIdentical(false, array_search(lmbIp::encode('192.168.0.0', lmbIp::USTRING), $ip_list));
     $this->assertNotIdentical(false, array_search(lmbIp::encode('192.168.0.1', lmbIp::USTRING), $ip_list));
     $this->assertNotIdentical(false, array_search(lmbIp::encode('192.168.0.255', lmbIp::USTRING), $ip_list));
     $this->assertNotIdentical(false, array_search(lmbIp::encode('192.168.10.10', lmbIp::USTRING), $ip_list));
     $this->assertIdentical(false, array_search(lmbIp::encode('192.168.10.11', lmbIp::USTRING), $ip_list));
 }