\apex\app\utilsgeoip

GeoIP library

Service: apex\svc\geoip

Small one method class that allows efficient geo lookups of IP addresses.

This class is available within the services container, meaning its methods can be accessed statically via the service singleton as shown below.

PHP Example

<?php

namespace apex;

use apex\app; use apex\svc\geoip;

// Lookup user's IP address $ip = geoip::lookup(); print_r($ip);

Summary

Methods
Properties
Constants
lookup()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

lookup()

lookup(string  $ipaddr = '') 

GeoIP an address, and return the country, state / province, and city. Uses MaxMin free goecitylite database.

Parameters

string $ipaddr

IP address to look up. Defaults to self::$ip_address.