You are here

function drush_mongodb_conf in MongoDB 7

Same name and namespace in other branches
  1. 6 mongodb.drush.inc \drush_mongodb_conf()

Drush callback; Print the config of the mongodb.

File

./mongodb.drush.inc, line 157
Provide drush integration for MongoDB.

Code

function drush_mongodb_conf($alias = 'default') {
  $connections = variable_get('mongodb_connections', array());
  $connections += array(
    'default' => array(
      'host' => 'localhost',
      'db' => 'drupal',
    ),
  );
  if (drush_get_option('all', FALSE)) {
    $specs = $connections;
  }
  else {
    $specs = $connections['default'];
  }
  if (!isset($specs)) {
    $specs = array();
  }
  drush_print_r($specs);
}