Download the PHP package maxmind-db/reader without Composer

On this page you can find all versions of the php package maxmind-db/reader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package reader

MaxMind DB Reader PHP API

Description

This is the PHP API for reading MaxMind DB files. MaxMind DB is a binary file format that stores data indexed by IP address subnets (IPv4 or IPv6).

Installation (Composer)

We recommend installing this package with Composer.

Download Composer

To download Composer, run in the root directory of your project:

You should now have the file composer.phar in your project directory.

Install Dependencies

Run in your project root:

You should now have the files composer.json and composer.lock as well as the directory vendor in your project directory. If you use a version control system, composer.json should be added to it.

Require Autoloader

After installing the dependencies, you need to require the Composer autoloader from your code:

Installation (Standalone)

If you don't want to use Composer for some reason, a custom autoload.php is provided for you in the project root. To use the library, simply include that file,

and then instantiate the reader class normally:

Installation (RPM)

RPMs are available in the official Fedora repository.

To install on Fedora, run:

To install on CentOS or RHEL 7, first enable the EPEL repository and then run:

Please note that these packages are not maintained by MaxMind.

Usage

Example

Optional PHP C Extension

MaxMind provides an optional C extension that is a drop-in replacement for MaxMind\Db\Reader. In order to use this extension, you must install the Reader API as described above and install the extension as described below. If you are using an autoloader, no changes to your code should be necessary.

Installing Extension

First install libmaxminddb as described in its README.md file. After successfully installing libmaxmindb, you may install the extension from pecl:

Alternatively, you may install it from the source. To do so, run the following commands from the top-level directory of this distribution:

You then must load your extension. The recommended method is to add the following to your php.ini file:

Note: You may need to install the PHP development package on your OS such as php5-dev for Debian-based systems or php-devel for RedHat/Fedora-based ones.

128-bit Integer Support

The MaxMind DB format includes 128-bit unsigned integer as a type. Although no MaxMind-distributed database currently makes use of this type, both the pure PHP reader and the C extension support this type. The pure PHP reader requires gmp or bcmath to read databases with 128-bit unsigned integers.

The integer is currently returned as a hexadecimal string (prefixed with "0x") by the C extension and a decimal string (no prefix) by the pure PHP reader. Any change to make the reader implementations always return either a hexadecimal or decimal representation of the integer will NOT be considered a breaking change.

Support

Please report all issues with this code using the GitHub issue tracker.

If you are having an issue with a MaxMind service that is not specific to the client API, please see our support page.

Requirements

This library requires PHP 7.2 or greater.

The GMP or BCMath extension may be required to read some databases using the pure PHP API.

Contributing

Patches and pull requests are encouraged. All code should follow the PSR-1 and PSR-2 style guidelines. Please include unit tests whenever possible.

Versioning

The MaxMind DB Reader PHP API uses Semantic Versioning.

Copyright and License

This software is Copyright (c) 2014-2024 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0.


All versions of reader with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package maxmind-db/reader contains the following files

Loading the files please wait ....