0

我对 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 一起工作??

4

3 回答 3

1

解决了 !! 问题在于 LOADER.php 中的代码点火器类声明。如果您收到此错误,请添加以下行。代码点火器不允许加载页面,如果

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

在文件开头未找到,则 Code igniter 跳过该文件。

于 2013-09-17T08:06:21.247 回答
0

除了配置文件之外,您还需要添加和加载库。

https://github.com/huglester/MongoDB-CodeIgniter-Driver/blob/master/libraries/Mongo_db.php

https://github.com/huglester/MongoDB-CodeIgniter-Driver/blob/master/README

该错误表明您尚未添加或加载库。

于 2013-09-16T14:19:32.783 回答
0

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

于 2016-08-24T08:06:39.227 回答