Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added local MaxMind country database support #106

Merged
merged 1 commit into from
Apr 6, 2022
Merged

Added local MaxMind country database support #106

merged 1 commit into from
Apr 6, 2022

Conversation

8ctopus
Copy link
Contributor

@8ctopus 8ctopus commented Apr 6, 2022

First of all, thank you for a great package.

For a project, I'm presently working on, we want to use only local data, so we are using the MaxMind mmdb files. I successfully extended your package in order use the much smaller Maxmind Country database when city location is not required. The database footprint is significantly reduced from 66Mb to 5.6Mb.

All existing tests are successful, however I didn't add any new test as I don't know how to download the MaxMind files for the tests.

@stevebauman stevebauman merged commit c2c863c into stevebauman:master Apr 6, 2022
@stevebauman
Copy link
Owner

Thanks for the great PR @8ctopus! 🙏 I'll have a release out shortly.

@8ctopus 8ctopus deleted the maxmind-country branch April 6, 2022 12:54
@8ctopus
Copy link
Contributor Author

8ctopus commented Apr 6, 2022

Thank you for accepting my suggestions. Do you happen to know how we could test the local MaxMind databases? It would be good that this gets tested as well.

@stevebauman
Copy link
Owner

We could file_get_contents() to download it in the test environment and then run some tests using it (as long as there's a direct download somewhere). Otherwise we could store the country database in a tests/fixtures folder (this folder won't be downloaded when installed via composer.

What do you think?

@stevebauman
Copy link
Owner

stevebauman commented Apr 6, 2022

I found their test databases that we can use (🎉 ) https://github.com/maxmind/MaxMind-DB

These are pretty small, so I'll download some of their databases (in test-data) and then use it for the tests 👍

@8ctopus
Copy link
Contributor Author

8ctopus commented Apr 6, 2022

Great! Thank you for the explanation. I will update the README tomorrow for the country database and can help finishing the tests once you did setup the base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants