Пример #1
0
 /**
  * Session initializing static method.
  *
  * @static
  * @access   public
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 public static function init()
 {
     static::$ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR');
     static::$userAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
     static::$sessionSettings = Config::get('session');
     static::checkCookie();
 }
Пример #2
0
 public static function init()
 {
     static::$initialized = true;
     static::$ip = static::getIpAddress();
 }
Пример #3
0
 /**
  * Client IP
  *
  * @return string
  */
 public static function ip()
 {
     // check cache
     if (static::$ip) {
         return static::$ip;
     }
     if (PHP_SAPI == 'cli') {
         return static::$ip = 'command line';
     }
     // The request was started from the command line
     if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         return static::$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
     }
     // If the server is behind proxy
     if (isset($_SERVER['HTTP_CLIENT_IP'])) {
         return static::$ip = $_SERVER['HTTP_CLIENT_IP'];
     }
     if (isset($_SERVER['REMOTE_ADDR'])) {
         return static::$ip = $_SERVER['REMOTE_ADDR'];
     }
     return static::$ip = '0.0.0.0';
 }
Пример #4
0
Файл: Ip.php Проект: Joal01/fof
 /**
  * Set the IP address of the current visitor
  *
  * @param   string  $ip
  *
  * @return  void
  */
 public static function setIp($ip)
 {
     static::$ip = $ip;
 }