Download the PHP package pier-infor/geoliteip without Composer
On this page you can find all versions of the php package pier-infor/geoliteip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pier-infor/geoliteip
More information about pier-infor/geoliteip
Files in pier-infor/geoliteip
Package geoliteip
Short Description Pier-Infor Geoliteip.
License LGPL-3.0-or-later
Homepage https://github.com/pierre-fromager/geoliteip
Informations about the package geoliteip
:elephant: geoliteip
Geoliteip is a php tool to use and manage maxmind GeoLite2 free databases in mmdb format.
:ocean: Features
- Use 3 free dbs as asn, country, city.
- Change db on the fly without re-instanciate.
- Input ip list from plain text file.
- Output as array, json, csv.
- Update dbs on the fly or from composer.
:thumbsup: Pro
- Flexibility and scalability with factory/adapter pattern.
- Annotated and tested with full coverage.
- Changing behaviours can be simply done by overloading/adding adapters.
- All constants class centralized in src/Interfaces can be overloaded;
:thumbsdown: Cons
- do not use non free GeoLite dbs (but can be extended to do the job).
:construction_worker: Dependencies
- geoip2/geoip2
:innocent: Testing & Coverage
-
before running tests install db doing
- Require xdebug to enable coverage.
- Tests all passed with php version >= 7.0.
- /!\ updater tests makes real db update from maxmind, abusing leads to a 503.
Composer
Facilities run
- db (download and install db in assets db).
- test (pass all tests).
- coverage (pass all tests with coverage).
- testIp (run IpTest only).
- testDownloader (run DownloaderTest only).
- testFileManager (run FileManagerTest only).
- testUpdater (run UpdaterTest only).
- lint (check and fix source errors).
Integration
Best is with composer :
To integrate the postInstall process, adjust your composer.json as below.
Dummy app
From the root of the project, create a src folder then a file app.php inside.
Copy paste the code below in app.php
From the root of the project running
Should be immediate with no errors and display messages as below
Changing forceUpdate to true will force update in silent mode.
You can figure out the accuracy changing from ipv4 to ipv6 for the same location.
:hamster: Todo
- Implement input arguments to read stdin.
- Find a good php documentation generator...