larryli/ipv4-medoo

IP v4 中国城市地址库 Medoo 数据库驱动

1.0.0 2015-09-19 06:56 UTC

README

通过 composer 安装

composer require larryli/ipv4-medoo

使用

$medoo = new \larryli\ipv4\medoo\Database([
    'database_type' => 'sqlite',
    'database_file' => __DIR__ . '/ipv4.sqlite',
]);
$monipdb = new \larryli\ipv4\MonipdbQuery(__DIR__ . '/17monipdb.dat');
if (!$monipdb->exists()) {
    $monipdb->init();
}
$qqwry = new \larryli\ipv4\QqwryQuery(__DIR__ . '/qqwry.dat');
if (!$qqwry->exists()) {
    $qqwry->init();
}
$your_query = new \larryli\ipv4\FullQuery($medoo);
if (!$your_query->exists()) {
    $your_query->init(null, $monipdb, $qqwry);
}
$your_query->find(ip2long('127.0.0.1'));

相关包