Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Reader Laravel Package

maxmind-db/reader

The official PHP API for reading MaxMind DB files, which store data indexed by IPv4 or IPv6 subnets. Install via Composer for the pure PHP implementation or the C extension for faster lookups.

View on GitHub
Deep Wiki
Context7
v1.14.0
  • Bounded the resources that the pure PHP decoder spends on a single lookup. A crafted database could nest data-section pointers to shared targets so that decoding one record cost exponential time and memory, or point many times at one large value so that the decoder copied far more data than the file holds. The decoder now follows the Reader Resource Limits section of the MaxMind DB specification. Each lookup is limited to 65,536 values, 512 levels of nesting, and 2 MiB of string and bytes payload.
    • Exceeding a limit throws an InvalidDatabaseException.
    • Opening a database whose metadata exceeds a limit throws the same exception.
    • A scalar that declares more than 16 bytes, the width of the widest fixed-width type, is rejected as invalid data.
  • The bundled libmaxminddb used by --with-maxminddb-bundled builds of the extension now applies the same decoder limits. The extension throws an InvalidDatabaseException when a lookup exceeds them.
  • The pure PHP reader is about 40% faster on City lookups. It no longer seeks before a read that continues where the last one ended, and it checks read lengths with strlen() instead of ftell().
  • The Windows build configuration now accepts either libmaxminddb.lib or maxminddb.lib when building the extension. The lib prefix was removed in libmaxminddb 1.6.0, but the libmaxminddb that PHP publishes for Windows builds is still 1.5.0, which uses the prefixed name. Pull request by Jean-Baptiste Nahan. GitHub #231.
  • Replaced XtOffsetOf() with offsetof(). The XtOffsetOf() alias has been removed in PHP 8.6. Pull request by Remi Collet. GitHub #252.
  • The extension can now be built from a bundled copy of libmaxminddb, on both Unix-like systems and Windows, by passing --with-maxminddb-bundled to configure (or to configure.bat on Windows). This produces an extension that does not depend on a system libmaxminddb, which is a prerequisite for distributing precompiled builds; on Windows it also replaces the 1.5.0 import library that PHP publishes for Windows builds. The default is unchanged: without the flag, the extension links against a system libmaxminddb as before. GitHub #265.
  • The conflict constraint on ext-maxminddb in composer.json is again updated when a release is cut. The substitution that maintains it stopped matching in April 2024, when the constraint's separator changed from a comma to ||, so the constraint has read <1.11.1 through four releases. Users of the C extension should note the effect of reviving it: ext-maxminddb is a Composer platform package, so this release conflicts with an older compiled extension and composer update will require upgrading the two together. GitHub #266.
v1.13.1
  • First PIE release. No other changes.
v1.13.0
  • A redundant filesize() call in the reader's constructor was removed. Pull request by Pavel Djundik. GitHub #189.
v1.12.1
  • The C extension now checks that the database metadata lookup was successful.
v1.12.0
  • Improve the error handling when the user tries to open a directory with the pure PHP reader.
  • Improve the typehints on arrays in the PHPDocs.
v1.11.1
  • Resolve warnings when compiling the C extension.
  • Fix various type issues detected by PHPStan level. Pull request by LauraTaylorUK. GitHub #160.
v1.11.0
  • Replace runtime define of a constant to facilitate opcache preloading. Reported by vedadkajtaz. GitHub #134.
  • Resolve minor issue found by the Clang static analyzer in the C extension.
v1.10.1
  • Fix a TypeError exception in the pure PHP reader when using large databases on 32-bit PHP builds with the bcmath extension. Reported by dodo1708. GitHub #124.
v1.10.0
  • When using the pure PHP reader, unsigned integers up to PHP_MAX_INT will now be integers in PHP rather than strings. Previously integers greater than 2^24 on 32-bit platforms and 2^56 on 64-bit platforms would be strings due to the use of gmp or bcmath to decode them. Reported by Alejandro Celaya. GitHub #119.
v1.9.0
  • The maxminddb extension is now buildable on Windows. Pull request by Jan Ehrhardt. GitHub #115.
v1.8.0
  • Fixes for PHP 8.0. Pull Request by Remi Collet. GitHub #108.
v1.7.0
  • IMPORTANT: PHP 7.2 or greater is now required.
  • The extension no longer depends on the pure PHP classes in maxmind-db/reader. You can use it independently.
  • Type hints have been added to both the pure PHP implementation and the extension.
  • The metadata method on the reader now returns a new copy of the metadata object rather than the actual object used by the reader.
  • Work around PHP is_readable() bug. Reported by Ben Roberts. GitHub #92.
  • This is the first release of the extension as a PECL package. GitHub #34.
v1.6.0
  • 1.5.0 and 1.5.1 contained a possible memory corruptions when using getWithPrefixLen. This has been fixed. Reported by proton-ab. GitHub #96.
  • The composer.json file now conflicts with all versions of the maxminddb C extension less than the Composer version. This is to reduce the chance of having an older, conflicting version of the extension installed. You will need to upgrade the extension before running composer update. Pull request by Benoît Burnichon. GitHub #97.
v1.5.1
  • Minor performance improvements.
  • Make tests pass with older versions of libmaxminddb. PR by Remi Collet. GitHub #90.
  • Test enhancements. PR by Chun-Sheng, Li. GitHub #91.
v1.5.0
  • PHP 5.6 or greater is now required.
  • The C extension now supports PHP 8. Pull request by John Boehr. GitHub #87.
  • A new method, getWithPrefixLen, was added to the Reader class. This method returns an array containing the record and the prefix length for that record. GitHub #89.
v1.4.1
  • The maxminddb extension now returns a string when a uint32 value is greater than LONG_MAX. Previously, the value would overflow. This generally only affects 32-bit machines. Reported by Remi Collet. GitHub #79.
  • For uint64 values, the maxminddb extension now returns an integer rather than a string when the value is less than or equal to LONG_MAX. This more closely matches the behavior of the pure PHP reader.
v1.4.0
  • The maxminddb extension now has the arginfo when using reflection. PR by Remi Collet. GitHub #75.
  • The maxminddb extension now provides MINFO() function that displays the extension version and the libmaxminddb version. PR by Remi Collet. GitHub #74.
  • The maxminddb configure script now uses pkg-config when available to get libmaxmindb build info. PR by Remi Collet. GitHub #73.
  • The pure PHP reader now correctly decodes integers on 32-bit platforms. Previously, large integers would overflow. Reported by Remi Collet. GitHub #77.
  • There are small performance improvements for the pure PHP reader.
v1.3.0
  • IMPORTANT: The maxminddb extension now obeys open_basedir. If open_basedir is set, you must store the database within the specified directory. Placing the file outside of this directory will result in an exception. Please test your integration before upgrading the extension. This does not affect the pure PHP implementation, which has always had this restriction. Reported by Benoît Burnichon. GitHub #61.
  • A custom autoload.php file is provided for installations without Composer. GitHub #56.
v1.2.0
  • PHP 5.4 or greater is now required.
  • The Reader class for the maxminddb extension is no longer final. This was change to match the behavior of the pure PHP class. Reported and fixed by venyii. GitHub #52 & #54.
v1.1.3
  • Fix incorrect version in ext/php_maxminddb.h. GitHub #48.
v1.1.2
  • Searching for database metadata only occurs within the last 128KB (128 * 1024 bytes) of the file, speeding detection of corrupt datafiles. Reported by Eric Teubert. GitHub #42.
  • Suggest relevant extensions when installing with Composer. GitHub #37.
v1.1.1
  • Development files were added to the .gitattributes as export-ignore so that they are not part of the Composer release. Pull request by Michele Locati. GitHub #39.
v1.1.0
  • The MaxMind DB extension now supports PHP 7. Pull request by John Boehr. GitHub #27.
v1.0.3
  • All uses of strlen were removed. This should prevent issues in situations where the function is overloaded or otherwise broken.
v1.0.2
  • Previously the MaxMind DB extension would cause a segfault if the Reader object's destructor was called without first having called the constructor. (Reported by Matthias Saou & Juan Peri. GitHub #20.)
v1.0.1
  • In the last several releases, the version number in the extension was incorrect. This release is being done to correct it. No other code changes are included.
v1.0.0
  • First production release.
  • In the pure PHP reader, a string length test after fread() was replaced with the difference between the start pointer and the end pointer. This provided a 15% speed increase.
v0.3.3
  • Clarified behavior of 128-bit type in documentation.
  • Updated phpunit and fixed some test breakage from the newer version.
v0.3.2
  • Fixed invalid reference to global class RuntimeException from namespaced code. Fixed by Steven Don. GitHub issue #15.
  • Additional documentation of Metadata class as well as misc. documentation cleanup.
v0.3.1
  • The API now works when mbstring.func_overload is set.
  • BCMath is no longer required. If the decoder encounters a big integer, it will try to use GMP and then BCMath. If both of those fail, it will throw an exception. No databases released by MaxMind currently use big integers.
  • The API now officially supports HHVM when using the
v0.3.0
  • This API is now licensed under the Apache License, Version 2.0.
  • The code for the C extension was cleaned up, fixing several potential issues.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator