Kohana_Auth::instance PHP Méthode

instance() public static méthode

Singleton pattern
public static instance ( ) : Auth
Résultat 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;
    }