| Server IP : 89.108.64.180 / Your IP : 216.73.216.60 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/hostel76.com/wp-content/plugins/wordfence/waf/ |
Upload File : |
<?php
require_once(dirname(__FILE__) . '/../vendor/autoload.php');
use GeoIp2\Database\Reader;
if (!defined('WFWAF_RUN_COMPLETE')) {
class wfWAFGeoIP2 {
private $_reader;
/**
* Returns the singleton wfWAFGeoIP2.
*
* @return wfWAFGeoIP2
*/
public static function shared() {
static $_geoip = null;
if ($_geoip === null) {
$_geoip = new wfWAFGeoIP2();
}
return $_geoip;
}
public function __construct() {
try {
if (file_exists(WFWAF_LOG_PATH . '/GeoLite2-Country.mmdb')) {
$this->_reader = new Reader(WFWAF_LOG_PATH . '/GeoLite2-Country.mmdb');
return;
}
}
catch (Exception $e) {
//Fall through to bundled copy
}
$this->_reader = new Reader(__DIR__ . '/../lib/GeoLite2-Country.mmdb'); //Can throw, but we don't catch it because it means the installation is likely corrupt and needs fixed anyway
}
/**
* Returns the database version in use. This is the timestamp of when it was packaged.
*
* @return null|int
*/
public function version() {
try {
return $this->_reader->metadata()->buildEpoch;
}
catch (Exception $e) {
//Fall through
}
return null;
}
/**
* Returns the country code for the IP if known.
*
* @param string $ip
* @return null|string
*/
public function countryCode($ip) {
try {
$record = $this->_reader->country($ip);
return $record->country->isoCode;
}
catch (Exception $e) {
//Fall through
}
return null;
}
}
}