Giter VIP home page Giter VIP logo

easygeo's Introduction

easyGeo

中文说明

features

  1. Update ip db file
  2. Wrapper of geolite city & asn , it will return an array include city & asn info.

Update ip db file

Get your licenser_key from your maxmind account.and then run the code as bellow

<?php
use mallka\easygeo\Geo;
\mallka\easygeo\Geo::update('Your key','/path/to/your_db_floder');

Get extra info of ip

<?php
use mallka\easygeo\Geo;
$res = \mallka\easygeo\Geo::getInfo('113.110.215.242','./store/GeoLite2-City.mmdb','./store/GeoLite2-ASN.mmdb',$lang='zh-CN');
$res = json_encode($res);

/**
$res will display as bellow:
{
    "city":"深圳市",
    "continent":"亚洲",
    "country":"**",
    "registered_country":"**",
    "province":"广东",
    "country_code":"CN",
    "province_code":"GD",
    "location"":{
        "accuracy_radius":5,
        "latitude":22.5333,
        "longitude":114.1333,
        "time_zone":"Asia/Shanghai"
    },
    "autonomous_system_number""":"AS4134",
    "organization"":"ASChinanet"
}
**/

How to install

via composer

composer require mallka/easygeo

via direct download

  1. download the file (include file)
  2. set floder permissions to 777 for store floder when you on linux ,like chmod -Rf 777 store
  3. use it or learn it from test.php

thanks :

  1. tronovav/geoip2-update
  2. maxmind-db/reader

easygeo's People

Contributors

anoshop avatar mallka avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.