【问题标题】:Error when using Auth with ORM driver kohana 3.3.0将 Auth 与 ORM 驱动程序 kohana 3.3.0 一起使用时出错
【发布时间】:2012-10-24 05:19:18
【问题描述】:

今天我下载了一个 3.3.0 但在使用 Auth 和 ORM 时出错:

致命错误:在中找不到类“Auth_Orm” /home/vsao4/domains/v4.mclub.vn/public_html/modules/auth/classes/Kohana/Auth.php 第 37 行

我的身份验证配置如下:

'driver'       => 'orm',
'hash_method'  => 'md5',
'hash_key'     => 'secret',
'lifetime'     => 1209600,
'session_type' => Session::$default,
'session_key'  => 'auth_user',

代码是:

 $ars = array(
                'username'=>'manhquan',
                'password'=>'232323',
                'email'=>'manhquan@fifthmediacorp.com'
            );
            if (Auth::instance()->login($ars['username'], $ars['password']))
            {

                    // sucessfully loged
                    $this->response->body('login');

            } else {
                //TODO error
                $this->response->body('not login');
            }

【问题讨论】:

  • okie 我发现了这一点。因为在 Kohana 3.3.0 中区分大小写,我们需要将驱动器输入为:'driver'=>'ORM' 而不是 orm
  • 仍然找不到问题类“ORM”。

标签: kohana-3 kohana-auth


【解决方案1】:

改变

'driver' => 'orm',

'driver' => 'ORM',

另外,Database_Mysql 类也会出错。同时更改您的 config/database.php 文件:

'type' => 'mysql',

'type' => 'MySQL',

这是由于新的 Kohana 约定而发生的: http://kohanaframework.org/3.3/guide/kohana/conventions

【讨论】:

  • 仍然找不到问题类“ORM”。
猜你喜欢
  • 2012-12-03
  • 1970-01-01
  • 2020-12-05
  • 2013-08-29
  • 1970-01-01
  • 2021-12-04
  • 1970-01-01
  • 1970-01-01
  • 2011-02-11
相关资源
最近更新 更多