I got installed MaxMind's GeoIp2 => https://github.com/maxmind/MaxMind-DB-Reader-php
Also php extension https://github.com/maxmind/libmaxminddb for faster lookup
Everything works just fine when i am using it like this:
require_once '/pathto/Composer/vendor/autoload.php';
use GeoIp2\Database\Reader;
$reader = new Reader('/pathto/GeoLite2-Country.mmdb');
$record = $reader->country('8.8.4.4');
The problem starts when i am trying to use it on same php file where i am also using my own autoloader:
function __autoload($class_name) {
$p = explode("\\", $class_name);
require_once 'pathto/'.$p[2].'.class.php';
}
It seems like this 2 autoloaders collide each other and in fact i cannot use GeoIp2 in file mixed with my classes.
How can i solve this annoying problem? Thank you so much in advance.