Giter Site home page Giter Site logo

tronovav / geoip2-update Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 15.0 16 KB

Update Maxmind.com GeoIP2/GeoLite2 databases from your php script, application or via Composer.

License: MIT License

PHP 100.00%
geoip2 geolite2 geo geolocation maxmind geoip2-databases geoip

geoip2-update's People

Contributors

tronovav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

geoip2-update's Issues

Add GeoIP2-ISP support

Kindly consider adding GeoIP2-ISP support : )

I added locally the following in $remoteEditions and it works just fine:

        'GeoIP2-ISP' => self::TYPE_MMDB,

Thanks : )

Updating databases via Composer Error. Missing geoipConfFile property in Client.php.

When using the "Use GeoIP.conf file:" to update databases via composer, the process fails every time with the following error:
The "geoipConfFile" parameter does not exist. Just remove it from the options. See https://github.com/tronovav/geoip2-update

Steps to reproduce the behavior:

  1. Updating via Composer using a GeoIP.conf file
  2. Using @composer when creating the path to the conf file
  3. Error Occurs when running Composer update.

Environment:

  • OS: Windows 10
  • PHP version: 7.4
  • tronovav/geoip2-update version: v2.1.16
  • Composer version: 2.1.6

Additional context
The issue appears to be a result of the Client.php constructor checking if each parameter exists as a property in the Client class.

if ($thisClass->hasProperty($key) && $thisClass->getProperty($key)->isPublic())

geoipConfFile is not a property in the Client.php file so this fails every time. I solved the problem by simply declaring the missing propery as public $geoipConfFile; in the Client.php file.

File operations are not atomic

Currently, the script deletes the directory and then extracts the new directory. If this was done while the application was running, it could lead to errors in the window of time between the deletion and when the files are fully extracted.

The official geoipupdate client avoids this issue by atomically replacing the file. It does this by extracting the new file to a temp file on the file system and then moving the new file over the old file. On unix systems, a move of a file on the file system is an atomic operation.

This is complicated a bit by the fact that this library is operating on directories rather than individual files as you cannot move a directory over another directory. If the library only handled MMDB files, I would recommend just operating on those individual files. However, the CSV files present a somewhat more difficult case as you want to replace them all at once. This could be accomplished by using a symlink to the actual directory and atomically replacing that.

This article covers this at a bit more depth. I only glanced at it, but the information seems correct.

unable to download files

Describe the bug

hi, im using this package to download updated free databases
I follow all steps but i receive this message : Edition ID: "GeoLite2-Country" not found in maxmind.com.
This message is in Client.php # 160.

To Reproduce
This is what i done:

  1. Create file geoupdate.php by example in documentation
  2. Call this script from browser : http://mydomain.com/geoupdate.php
  3. See Message on browser screen

Desktop (please complete the following information):

  • OS: window 10
  • Browser firefox
  • Version 88

Additional context
I tried to call generated url from Client.php in headers method link #226.
https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&suffix=tar.gz&license_key=mylicense
This works.
Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.