PHPackages                             vnagara/geoip-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vnagara/geoip-module

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vnagara/geoip-module
====================

Geoip module for zend framework application to store Record. It utilize maxmind database and API

1.1.0(11y ago)22.8k1[1 issues](https://github.com/vnagara/geoip-module/issues)BSD-3-ClausePHPPHP &gt;=5.3.3

Since Aug 11Pushed 11y ago1 watchersCompare

[ Source](https://github.com/vnagara/geoip-module)[ Packagist](https://packagist.org/packages/vnagara/geoip-module)[ RSS](/packages/vnagara-geoip-module/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

\#README

\##PROLOGUE

My project demands on detecting and storing accessed IP data.
So I found geoip/geoip package. And everything else is to store it.
The best way is serialize or create record in DB. The second way with Doctrine 2 is very slow as appeared in my experience.

\###Why not geoip2/geoip2 or MaxMind-DB-Reader-php with .mmdb Really? It contains wished class Record for serialization already but: As experiment showed:

- Record Object has all Country name translations what I do with internalization library.
- Record Object is too huge so Its serialization take too long string.
- **It much SLOWLY then geoip1 with sqlite db.** In 2-3 times. (Tested on about 2500 IPs)

So I decided to create alternate Record object that will utilize fast geoip sqlite db and fit to
now-day Object using. It easily can be extended to Doctrine Entity or Document.

\##How to install Install it by composer.

```
{
    "require": {
        "vnagara/geoip-module": "1.*"
    }
}

```

Download geoip sql DB to *data/GeoLiteCity.dat* or set another path in configuration file.
On linux with wget you can use this command (inside project root):

```
    wget -O - http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | gzip -dc > data/GeoLiteCity.dat

```

In *application.config.php* enable **GeoipModule** module.

\##New methods:

1. In view helpers: **geoipRecord($ipAddress)** will return GeoipRecord.
2. There is new service **geoip**. So in controller it is accessible by:

```
    /** @var \GeoipModule\Service\Geoip */
    $geoip = $this->getServiceLocator()->get('geoip');

    /** @var \GeoipModule\Object\Record */
    $recordOfSomeIpAddress = $geoip->find('184.154.227.14');
    $city = $recordOfSomeIpAddress->getCity();  // Chicago

    // The same:
    $recordOfSomeIpAddress = $geoip->lookup('184.154.227.14');

    // To use ip from $_SERVER['REMOTE_ADDR']
    $record = $geoip->find();

```

\##Doctrine ORM Template of Entity with annotation lays by path: **src/GeoipModule/Entity/Record.php**

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~293 days

Total

2

Last Release

4362d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7cc69a61a5fa9ccc9b3008b8204e21649d167301bd17be8d32ee1c027154ac4?d=identicon)[duke](/maintainers/duke)

---

Top Contributors

[![vnagara](https://avatars.githubusercontent.com/u/1571419?v=4)](https://github.com/vnagara "vnagara (8 commits)")

---

Tags

geoipzfzf2Zend Framework

### Embed Badge

![Health badge](/badges/vnagara-geoip-module/health.svg)

```
[![Health](https://phpackages.com/badges/vnagara-geoip-module/health.svg)](https://phpackages.com/packages/vnagara-geoip-module)
```

###  Alternatives

[zf-commons/zfc-base

A set of genetic (abstract) classes which are commonly used across multiple modules.

1441.1M25](/packages/zf-commons-zfc-base)[snapshotpl/zf-snap-geoip

MaxMind GeoIP Module for Zend Framework 2

1512.9k](/packages/snapshotpl-zf-snap-geoip)[facile-it/sentry-module

This module allows integration of Sentry Client into laminas and mezzio

19372.5k](/packages/facile-it-sentry-module)[spoonx/sxbootstrap

A twitter bootstrap module for ZF2 (zend framework 2) based on rwoverdijk/assetmanager

3010.7k1](/packages/spoonx-sxbootstrap)[sandrokeil/easy-config

Zend Framework 2 (zf2) module to retrieve specific module options and provides some abstract factories to create easily instances depending on configuration

113.1k1](/packages/sandrokeil-easy-config)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
