manzadey/sypexgeo

Supports GeoIP services

Maintainers

Package info

github.com/Manzadey/sypexgeo

pkg:composer/manzadey/sypexgeo

Fund package maintenance!

Open Collective

Statistics

Installs: 24

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1 2021-10-27 13:31 UTC

This package is auto-updated.

Last update: 2026-02-27 22:55:45 UTC


README

This package is intended for obtaining information about the IP address using the service database https://sypexgeo.net

Installation

composer require "manzadey/sypexgeo"

How used

Create an instance of the class and specify the path to the file and operation mode flags as arguments (optional):

use Manzadey\SypexGeo\SxGeo;

$sxGeo = new SxGeo('sxGeo.dat');

Defining the country:

$country = $sxGeo->getCountry($ip); // returns a two-digit ISO country code
$sxGeo->getCountryId($ip);          // returns the country number

Defining the city:

$sxGeo->getCity($ip);                 // returns brief information, without the name of the region, country and time zone
$sxGeo->getCityFull($ip);             // returns full information about the city, region and country
$city = $sxGeo->get($ip);             // executes getCountry or getCity depending on the type of database
$cityName = $sxGeo->getCityName($ip); // returns the name of the city