A1_Core::instance PHP Method

instance() public static method

Return a static instance of A1.
public static instance ( $_name = 'a1' ) : object
return object
    public static function instance($_name = 'a1')
    {
        static $_instances;
        if (!isset($_instances[$_name])) {
            $_config = Kohana::$config->load($_name);
            $_driver = isset($_config['driver']) ? $_config['driver'] : 'ORM';
            $_class = 'A1_' . ucfirst($_driver);
            $_instances[$_name] = new $_class($_name, $_config);
        }
        if (CRYPT_BLOWFISH !== 1) {
            throw new Kohana_Exception('This server does not support bcrypt hashing');
        }
        return $_instances[$_name];
    }