public function __construct($app = null)
{
if (!defined('USER_IP')) {
if (isset($_SERVER['REMOTE_ADDR'])) {
define('USER_IP', $_SERVER['REMOTE_ADDR']);
} else {
define('USER_IP', '127.0.0.1');
}
}
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
}