Kohana_Auth::instance PHP Method

instance() public static method

Singleton pattern
public static instance ( ) : Auth
return Auth
    public static function instance()
    {
        if (!isset(Auth::$_instance)) {
            // Load the configuration for this type
            $config = Kohana::config('auth');
            if (!($type = $config->get('driver'))) {
                $type = 'ORM';
            }
            // Set the session class name
            $class = 'Auth_' . ucfirst($type);
            // Create a new session instance
            Auth::$_instance = new $class($config);
        }
        return Auth::$_instance;
    }