Download the PHP package hostbrook/sypex-geo without Composer
On this page you can find all versions of the php package hostbrook/sypex-geo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hostbrook/sypex-geo
More information about hostbrook/sypex-geo
Files in hostbrook/sypex-geo
Package sypex-geo
Short Description Get location info by IP address
License Apache-2.0
Informations about the package sypex-geo
Sypex Geo - Get location info by IP address
This extension is based on Sypex Geo free databases and lets you get the next info by IP address:
- Country code by ISO 3166-2
- Region code by ISO 3166-2
- City name
- Region name
- Country name
- City Latitude/Longitude data
The language requirements: PHP version >=5.3.0
The databases release date: September 30, 2024
PHP frameworks integration
You have to use Composer to add Sypex Geo to your project based on PHP frameworks like Laravel, Yii, etc.
Installation
To get the latest version via Composer:
Usage
There are two different databases that come with the extension SxGeo.dat (country database, around 814kb) and SxGeoCity.dat (city database, around 39Mb). The city database contains the same country info from the country database, but heavier. So, do not use the city database if you need to get just a country code.
Usage with country database
If you need to get just a 2-symbol country code by ISO 3166-2:
Usage with city database
Example Data:
Addition parameters
If you need to work with multiple requests to a database, you can add two parameters during object creating to use caching and packet mode:
it can increase a response speed.
Upgrading
Whenever there is a new release, then from the command line in your project root:
Deleting package
Running the following command will remove the package from vendor folder: