2017 © Pedro Peláez
 

library sypexgeo

A PHP package for working with the SypexGeo database file.

image

antonmakasin/sypexgeo

A PHP package for working with the SypexGeo database file.

  • Wednesday, June 20, 2018
  • by antonmakasin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

SypexGeo PHP API

Latest stable version Build Status, (*1)

A PHP package for working with the SypexGeo database file., (*2)

The current version supports Laravel 5.5 and later. If you need support Laravel 5.4 or older, see version 1.*., (*3)

Installation for Laravel >=5.5

1. Add the package through composer:, (*4)

composer require eseath/sypexgeo

2. Publish config sxgeo.php (optionally):, (*5)

php artisan vendor:publish --provider="Eseath\SxGeo\SxGeoServiceProvider"

By default in config specified URL to the database of cities. If you want the database of countries, change url:, (*6)

...
    'dbFileURL' => 'https://sypexgeo.net/files/SxGeoCountry.zip',
...

3. Download the database file:, (*7)

php artisan sxgeo:update

You can use this command to upgrade database to the current version via CRON., (*8)

Also you can download the database manually:, (*9)

Usage

use Eseath\SxGeo\SxGeo;

$sxGeo = new SxGeo('/path/to/database/file.dat');
$fullInfo  = $sxGeo->getCityFull($ip)
$briefInfo = $sxGeo->get($ip);

With Laravel

use SxGeo;

$data = SxGeo::getCityFull($ip);

Example Data

array:3 [▼
    "city" => array:5 [▼
        "id" => 524901
        "lat" => 55.75222
        "lon" => 37.61556
        "name_ru" => "Москва"
        "name_en" => "Moscow"
    ]
    "region" => array:4 [▼
        "id" => 524894
        "name_ru" => "Москва"
        "name_en" => "Moskva"
        "iso" => "RU-MOW"
    ]
    "country" => array:6 [▼
        "id" => 185
        "iso" => "RU"
        "lat" => 60
        "lon" => 100
        "name_ru" => "Россия"
        "name_en" => "Russia"
    ]
]
array:2 [▼
    "city" => array:5 [▼
        "id" => 524901
        "lat" => 55.75222
        "lon" => 37.61556
        "name_ru" => "Москва"
        "name_en" => "Moscow"
    ]
    "country" => array:2 [▼
        "id" => 185
        "iso" => "RU"
    ]
]

The Versions

20/06 2018

dev-master

9999999-dev

A PHP package for working with the SypexGeo database file.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-zip *
  • php ^7.0

 

The Development Requires

by Ruslan A. (real author)
by Anton Makasin (just some changes)

laravel geoip geo sypexgeo sxgeo

20/06 2018

v2.0.1

2.0.1.0

A PHP package for working with the SypexGeo database file.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-zip *
  • php ^7.0

 

The Development Requires

by Avatar Ruslan A.

laravel geoip geo sypexgeo sxgeo

22/04 2018

v2.0.0

2.0.0.0

A PHP package for working with the SypexGeo database file.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-zip *
  • php ^7.0

 

The Development Requires

by Avatar Ruslan A.

laravel geoip geo sypexgeo sxgeo

26/02 2018

1.0.x-dev

1.0.9999999.9999999-dev

A PHP package for working with the SypexGeo database file.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-zip *
  • php >=5.6.4

 

The Development Requires

by Avatar Ruslan A.

laravel geoip geo sypexgeo sxgeo

26/02 2018

v1.1.0

1.1.0.0

A PHP package for working with the SypexGeo database file.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-zip *
  • php >=5.6.4

 

The Development Requires

by Avatar Ruslan A.

laravel geoip geo sypexgeo sxgeo

02/02 2017

v1.0.0

1.0.0.0

A PHP package for working with the SypexGeo database file.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-zip *
  • php >=5.6.4

 

The Development Requires

by Avatar Ruslan A.

laravel geoip geo sypexgeo sxgeo