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;
}