New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

admiral/geoip

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

admiral/geoip

CakePHP GeoIP plugin

cakephp-plugin
Source
Packagist
This package is abandoned and is no longer maintained.
The author recommends using true instead.
This version has been yanked by its maintainers and should not be used.
Version
1.0.0
Version published
Total downloads
1
Maintainers
1
Created
Source

GeoIP

Admiral plugin to get GeoIP data through the MaxMind GeoIP2 database

Getting Started

First, install the plugin using Composer

composer require admiral/geoip

Next, load the plugin into your Application.php:

class Application extends BaseApplication {
  public function bootstrap() {
    parent::bootstrap();

    // Load the GeoIP plugin
    $this->addPlugin('Admiral/GeoIP');
  }
}

Add some configs to your config/app.php:

'GeoIP' => [
  'license' => 'YOUR_LICENSE_KEY',
  'dir' => TMP, // Or the directory you desire
],

Download the databases of choice:

bin/cake geoip download --asn --city --country

Loading a database:

use Admiral\GeoIP\Database;

$asnDb = new Database('GeoLite2-ASN.mmdb')->getReader();

After which it serves identically to the library from MaxMind.

Version Compatibility

Below a table of version compatibility.
Please note that when a new version is released, support for older versions by the maintainer drop immediately.

Plugin VersionCakePHP Version
1.x>=3.6

FAQs

Package last updated on 23 Feb 2021

Related posts