コード例 #1
0
ファイル: AbstractIP.php プロジェクト: rendix2/QW_MVS
 public function __construct($ip, $safeMode = TRUE)
 {
     parent::__construct();
     if ($ip == NULL) {
         $ip = Server::get('remote_addr');
     }
     if (!self::isIP($ip)) {
         throw new IllegalArgumentException();
     }
     if (!Validator::isBool($safeMode)) {
         throw new IllegalArgumentException();
     }
     if (self::isIPv4($ip)) {
         $this->ipCoded = ip2long($ip);
         $this->ipParted = explode('.', $ip);
     } else {
         $this->ipCoded = self::ip6pack($ip);
         $this->ipParted = explode(':', $ip);
     }
     $this->ipCountPart = count($this->ipParted);
     $this->safeMode = $safeMode;
 }
コード例 #2
0
ファイル: BlackList.php プロジェクト: rendix2/QW_MVS
 public function __construct()
 {
     parent::__construct();
     $this->longOfIP = [];
     $this->myIp = new IPvU(Server::get('remote_addr'));
 }