Skip to content

Instantly share code, notes, and snippets.

@deepakaryan1988
Created November 14, 2014 07:10
Show Gist options
  • Save deepakaryan1988/53544075c9c0b9a18854 to your computer and use it in GitHub Desktop.
Save deepakaryan1988/53544075c9c0b9a18854 to your computer and use it in GitHub Desktop.
create local.settings.php for settings up mongodb by drupal
<?php
#MongoDB
$conf['mongodb_connections'] = array(
'default' => array( // Connection name/alias
'host' => 'localhost', // Omit USER:PASS@ if Mongo isn't configured to use authentication.
'db' => 'YOURDATABASENAME' // Database name. Make something up, mongodb will automatically create the database.
),
);
include_once('./includes/cache.inc');
# -- Configure Cache
$conf['cache_backends'][] = 'sites/SITENAME/modules/mongodb/mongodb_cache/mongodb_cache.inc';
$conf['cache_class_cache'] = 'DrupalMongoDBCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalMongoDBCache';
$conf['cache_default_class'] = 'DrupalMongoDBCache';
# -- Don't touch SQL if in Cache
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
# Session Caching
$conf['session_inc'] = 'sites/SITENAME/modules/mongodb/mongodb_session/mongodb_session.inc';
$conf['cache_session'] = 'DrupalMongoDBCache';
# Field Storage
$conf['field_storage_default'] = 'mongodb_field_storage';
# Message Queue
$conf['queue_default_class'] = 'MongoDBQueue';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment