不存在的类:Mongo_db

时间:2013-09-16 12:21:08

标签: php codeigniter mongodb ion-auth

我对ion_auth有疑问。我转换了Mongodb所需的所有文件。 我的配置文件 mongo_db.php

<?
   $config['mongo_host'] = 'localhost';
   $config['mongo_port'] = 27017;
   $config['mongo_db'] = 'tls_saas';
   $config['mongo_user'] = 'root';
   $config['mongo_pass'] = 'root';
   $config['mongo_persist'] = TRUE;
   $config['mongo_persist_key'] = 'ci_mongo_persist';
   ?>

ion_auth.php

$config['use_mongodb'] = TRUE;

/*
| -------------------------------------------------------------------------
| MongoDB Collection.
| -------------------------------------------------------------------------
| Setup the mongodb docs using the following command:
| $ mongorestore sql/mongo
|
*/
$mongorestore                    = 'sql/mongo';
$config['collections']['users']          = 'users';
$config['collections']['groups']         = 'groups';
$config['collections']['login_attempts'] = 'login_attempts';

但我仍然收到错误

  

不存在的类:Mongo_db

是他们要做出更多改变。 ion_auth现在使用mongodb ??

3 个答案:

答案 0 :(得分:1)

已解决!! 问题在于LOADER.php中的代码点火器类声明。 如果出现此错误,请添加以下行。如果

,代码点火器不允许加载页面
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
在文件开头找不到

,然后Code igniter跳过该文件。

答案 1 :(得分:0)

答案 2 :(得分:0)

位于system / libraries / Mongo_db.php中的'Mongo_db'库,请编辑此文件并将类名称从'Mongo_db'修改为'CI_Mongo_db',以解决此问题。

相关问题