Question

I have a problem with ion_auth . I converted all required file fit for Mongodb. my config liles 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';

but still i get the error

Non-existent class: Mongo_db

is their to make any more changes . ion_auth working with mongodb now ??

Était-ce utile?

La solution

SOLVED !! Problem was with code igniter class declaration in LOADER.php . Add the following lines if you get this error. Code igniter does not allow pages to be loaded if

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

is not found at the beginning of the file then Code igniter skip that file .

Autres conseils

You need to add and load the library in addition to the config files.

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

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

That error indicates you have not added or loaded the library.

the 'Mongo_db' library which is located in system/libraries/Mongo_db.php ,please edit this file and modify the class name from 'Mongo_db' to 'CI_Mongo_db' that will fixed this issue.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top