2017 © Pedro Peláez
 

library sxgeo

Library for Sypex Geo2

image

kipkaev55/sxgeo

Library for Sypex Geo2

  • Wednesday, May 10, 2017
  • by kipkaev55
  • Repository
  • 1 Watchers
  • 0 Stars
  • 468 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 71 % Grown

The README.md

SypexGeo Reader

Description

This package provides information about the user's GEO, works with free Sypex Geo2., (*1)

Install via Composer

We recommend installing this package with Composer., (*2)

Download Composer

To download Composer, run in the root directory of your project:, (*3)

curl -sS https://getcomposer.org/installer | php

You should now have the file composer.phar in your project directory., (*4)

Install Dependencies

Run in your project root:, (*5)

php composer.phar require kipkaev55/sxgeo:1.0.1

You should now have the files composer.json and composer.lock as well as the directory vendor in your project directory. If you use a version control system, composer.json should be added to it., (*6)

## Update database on "composer install" command

Put "post-install-cmd" event to composer.json, (*7)

"scripts": {
    "post-install-cmd": [
        "SypexGeo\\Composer::installDatabases"
    ],
    "post-update-cmd": [
        "SypexGeo\\Composer::installDatabases"
    ]
}

Put "extra" settings to composer.json, (*8)

"extra": {
    "sypexgeo_remote": "https://sypexgeo.net/files/SxGeoCity_utf8.zip",
    "sypexgeo_local": "vendor/kipkaev55/sxgeo/SxGeoCity.dat"
}

Require Autoloader

After installing the dependencies, you need to require the Composer autoloader from your code:, (*9)

require 'vendor/autoload.php';

Usage

Straightforward:, (*10)

require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload

use SypexGeo\Reader;

$reader = new Reader('SxGeoCity.dat', 'ru');
var_export($reader->getGeo('127.0.0.1'));
var_export($reader->getGeo('192.168.0.1'));
var_export($reader->getGeo('217.25.213.220'));
  • This software is Copyright (c) 2017 by Pro.Motion.
  • This is free software, licensed under the MIT license
  • SypexGeo licensed under the BSD.

The Versions

10/05 2017

dev-master

9999999-dev

Library for Sypex Geo2

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Kipkaev

10/05 2017

1.1.1

1.1.1.0

Library for Sypex Geo2

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Kipkaev

04/05 2017

1.1.0

1.1.0.0

Library for Sypex Geo2

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Kipkaev

04/05 2017

1.0.2

1.0.2.0

Library for Sypex Geo2

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Kipkaev

18/04 2017

1.0.1

1.0.1.0

Library for Sypex Geo2

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Kipkaev

14/04 2017

1.0.0

1.0.0.0

Library for Sypex Geo2

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Valerii Kipkaev