public function getIp()
    {
        if ($this->X_FORWARDED_FOR) {
            return $this->X_FORWARDED_FOR;
        }

        if ($this->CLIENT_IP) {
            return $this->CLIENT_IP;
        }

        if ($this->SERVER_NAME) {
            return gethostbyname($this->SERVER_NAME);
        }

        return $this->REMOTE_ADDR;
    }