Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 with MongoDB for Session
#1

[eluser]dioramayuanito[/eluser]
http://www.4shared.com/file/FpZM49Vw/ci2...ssion.html

in your /application/config/config.php
please add this line
Code:
$config['sess_use_mongo'] = TRUE;

put and set your own mongo configuration
in /application/config/mongo.php

put MY_Session.php and Mymongo.php into your /application/libraries

test it...

Thanks for Juhana Räsänen and Stephen Curran for his code (CI 1.7.2)

happy coding everybody !
#2

[eluser]dioramayuanito[/eluser]
[quote author="D10R4M4" date="1297954658"]http://www.4shared.com/file/FpZM49Vw/ci20mongosession.html

in your /application/config/config.php
please add this line
Code:
$config['sess_use_mongo'] = TRUE;

put and set your own mongo configuration
in /application/config/mongo.php

put MY_Session.php and Mymongo.php into your /application/libraries

test it...

Thanks for Juhana Räsänen and Stephen Curran for his code (CI 1.7.2)

happy coding everybody ![/quote]

you can use Mymongo.php for accessing mongodb
example

Code:
<?php

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

class Mongotest extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->library('mymongo');
    }

    function index() {
                $collection = 'ci_sessions';
                $criteria_of_doc = array('session_id'=>'f52d6f0dd09a71d6e7be5ee739618b13'); //example if exist
        $docs = $this->mymongo->db->{$collection}->findOne($criteria);
                var_dump($docs);
    }

}
#3

[eluser]Unknown[/eluser]
Link isn't valid any more.. can you post this somewhere or PM it to me?




Theme © iAndrew 2016 - Forum software by © MyBB