private function hasActiveDriver() { try { $geoipDriver = GeoIp_Driver::getInstance(); } catch (Exception $e) { return false; } return true; }
/** * Return instance of first active driver * * @return GeoIp_Driver */ public static function getInstance() { if (self::$instance === null) { $fileDb = new GeoIp_Driver_File(); if ($fileDb->isActive()) { self::$instance = $fileDb; return self::$instance; } throw new Gpf_Exception('No GeoIp driver available'); } return self::$instance; }
/** * @throws Gpf_Exception */ public function load() { $geoipDriver = GeoIp_Driver::getInstance(); $geoipDriver->loadLocation($this); }
public function onActivate() { //check if geo ip driver is active $geoipDriver = GeoIp_Driver::getInstance(); }