class Drush in MongoDB 8
Hierarchy
- class \Drupal\Driver\Database\mongodb\Drush extends \Drush\Sql\SqlBase
Expanded class hierarchy of Drush
File
- drivers/
lib/ Drupal/ Driver/ Database/ mongodb/ Drush.php, line 7
Namespace
Drupal\Driver\Database\mongodbView source
class Drush extends SqlBase {
public function command() {
return 'mongo';
}
public function __construct($db_spec = NULL) {
if (isset($db_spec['host'])) {
$db_spec['database'] = 'mongodb://' . $db_spec['host'] . '/' . $db_spec['database'];
}
parent::__construct($db_spec);
}
public function creds($hide_password = TRUE) {
$parameters = [];
if ($this->db_spec['username']) {
$parameters['u'] = $this->db_spec['username'];
}
if ($this->db_spec['password']) {
$parameters['p'] = $this->db_spec['password'];
}
$return = $parameters ? $this
->params_to_options($parameters) : '';
// The mongo shell doesn't want the mongodb:// in the beginning.
return $return . ' ' . substr($this->db_spec['database'], 10);
}
public function createdb($quoted = FALSE) {
}
public function drop_or_create() {
$this
->query("db.dropDatabase()");
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Drush:: |
public | function | ||
Drush:: |
public | function | ||
Drush:: |
public | function | ||
Drush:: |
public | function | ||
Drush:: |
public | function |