Skip to content

Instantly share code, notes, and snippets.

@spacemonkey
Created November 24, 2011 12:22

Revisions

  1. spacemonkey created this gist Nov 24, 2011.
    19 changes: 19 additions & 0 deletions connections.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    /**
    * Example of a production database called "db_prod" connecting to a replica set
    * running on two systems, "db1" and "db2" with the replica set name of "prod_01".
    *
    * This setup assumes that you're running a recent version of MongoDB as well as
    * the PHP extension.
    **/
    Connections::add('default', array(
    'production' => array(
    'type' => 'MongoDb',
    'database' => 'db_prod',
    'host' => array(
    'db1.mywebsite.com',
    'db2.mywebsite.com'
    ),
    'replicaSet' => 'prod_01',
    'setSlaveOkay' => true
    )
    )