You are here

function drush_mongodb_conf in MongoDB 6

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

Drush callback; Print the config of the mongodb.

File

./mongodb.drush.inc, line 144
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);
}