コード例 #1
0
ファイル: icepay_adapter.php プロジェクト: vazahat/dudex
 public function detectCountry()
 {
     try {
         $sql = 'SELECT `cc2` FROM `' . BOL_GeolocationIpToCountryDao::getInstance()->getTableName() . '`
             WHERE inet_aton(:ip) >= ipFrom AND inet_aton(:ip) <= ipTo';
         return OW::getDbo()->queryForColumn($sql, array('ip' => OW::getRequest()->getRemoteAddress()));
     } catch (Exception $e) {
         return null;
     }
 }
コード例 #2
0
ファイル: geolocation_service.php プロジェクト: vazahat/dudex
 private function __construct()
 {
     $this->countryDao = BOL_GeolocationCountryDao::getInstance();
     $this->ipCountryDao = BOL_GeolocationIpToCountryDao::getInstance();
     $this->isAvailable = $this->countryDao->doesTableExist();
 }