MongoDB, PHP, Yii Framework

MongoYii – A Yii MongoDB ORM

I made a Yii MongoDB ORM. It supports MongoDB and attempts to conform to Yii’s own standards as much as possible; it is named MongoYii.

You can find it and its documentation here:


23 thoughts on “MongoYii – A Yii MongoDB ORM

    1. I haven’t really considered it actually, I have never used IRC before and I normally spend all my time bashing people on stackoverflow lol, but I might have to drop by and see what’s happening 🙂

    1. Do you mind if I release this on my github or post it as a extension on Yii site, I will most likely add it to a util repo which people can download to get awesome addons for MongoYii

      1. All right!

        Some addtion to the docs

        — main configuration:

        ‘cache’ => array(
        // ‘mongoConnectionId’ => ‘mongodb’,
        // ‘collectionName’ => ‘mongodb_cache’,
        ‘ensureIndex’ => true, //set to false after first use of the cache


        — usage:

        // flush cache

        // add data to cache
        Yii::app()->cache->set(‘apple’, ‘fruit’);
        Yii::app()->cache->set(‘onion’, ‘vegetables’);
        Yii::app()->cache->set(1, ‘one’);
        Yii::app()->cache->set(2, ‘two’);
        Yii::app()->cache->set(‘one’, 1);
        Yii::app()->cache->set(‘two’, 2);

        // delete from cache

        // read from cache
        echo Yii::app()->cache->get(2);
        echo “”;

        // multiple read from cache
        $arr = Yii::app()->cache->mget(array(‘apple’, 1, ‘two’));

        echo “

          echo "


        — output:

        [apple] => fruit
        [1] =>
        [two] =>

    1. Maybe though that one is larger than the EMongoSession, I also modified the EWebUser and UserIdentity. Maybe put it as its own repo or something, gotta decide.

  1. What do you think about creating a newsletter extension later? I have some knowledge about this topic, but my English and git knowledge pure.

  2. mongo db without mx record optimalisation

    stat: [
    [year_and_month:’2013.01′, sent:27372, failed:1322]

    mails [
    stat: [sent:8, failed:1],
    mx_server: ‘’,
    mxweight: 22,

    newsletter: [
    mail_from: ‘’,
    name_from: ‘Admin’,
    subject: ‘minta hírlevél’,
    content_plain: ‘szöveg’,
    content_html: ‘szöveg‘,
    satus: ‘imported’,
    stat: [sent:8, failed:1]

    mail_queue: [
    mail_to: ‘’,
    name_to: ‘Teszt Elek’,
    id_newsletter: {newsletter.mongoId}

    mail_log: [
    status: ‘sent/failed’
    mail_to: ‘’,
    name_to: ‘Teszt Elek’,
    id_newsletter: {newsletter.mongoId}

    1. Ah I see what you mean, is this directly relatable to the core of Yii like CCache or CMessageSource etc?

      Really the MongoYii repo itself is more about core extension stuff else it starts to become bloated without need.

  3. Several years ago I didn’t use yii and I had some native php newsletter implementation. This year one of my customer asked me to develop a newsletter module to his (my yii based) webshop.
    I think it is a repeated task and most of web development use newsletter. I think the phpmailer, yii-cli and your mongoyii (or database abstract) extensions and the core yii enough to this task.
    I think the scheduler will be a cron based php-yii-script.

    1. This would be great as its own extension to the MongoYii extension but it is something that is probably best kept away from the main repo if I am honest. A proper newsletter module could get quite vast and it seems unproper to bloat the main repo with it.

      But it is an awesome idea and I really think you should work towards releasing that on your github and the yii website, I think you could get a solid user base. From having to find email modules recently I know that Yii extensions are lacking on that front.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s