Search code examples
phpcodeignitermongodbion-auth

Non-existent class: Mongo_db


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 ??


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 .