/** * Get current user object * @return User */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }
public static function app() { if (self::$instance == null) { self::$instance = new self(); } return self::$instance; }
public static function login($email, $passwd) { $user = static::select()->where('email = ? and passwd = ?', $email, md5($passwd))->get(1); if (!$user) { return false; } self::setCookie($user); return self::$instance = $user; }