function database_sanitize_drush_command in Database Sanitize 7
Same name and namespace in other branches
- 8 drush/database_sanitize.drush8.inc \database_sanitize_drush_command()
Implements hook_drush_command().
File
- drush/
database_sanitize.drush8.inc, line 30 - Drush Database Sanitize commands.
Code
function database_sanitize_drush_command() {
$sanitize_filename = 'database.sanitize.yml';
$items['db-sanitize-analyze'] = [
'description' => "Compares existing {$sanitize_filename} files on the site installation against existing database tables.",
'callback' => 'database_sanitize_analyze',
'aliases' => [
'dbsa',
],
'options' => [
'file' => [
'description' => 'The full path to a sanitize YML file.',
'required' => FALSE,
'example-value' => "NON-PUBLIC-FOLDER/{$sanitize_filename}",
],
'list' => [
'description' => 'List the table names.',
'required' => FALSE,
],
],
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
];
$items['db-sanitize-generate'] = [
'description' => "Generates a {$sanitize_filename} file for tables not specified on sanitize YML files.",
'callback' => 'database_sanitize_generate',
'aliases' => [
'dbsg',
],
'options' => [
'file' => [
'description' => 'The full path to a sanitize YML file.',
'required' => FALSE,
'example-value' => "NON-PUBLIC-FOLDER/{$sanitize_filename}",
],
'machine-name' => [
'description' => 'The machine name to export the tables under.',
'required' => TRUE,
'example-value' => 'MODULE_NAME',
],
],
'outputformat' => [
'default' => 'yaml',
'output-data-type' => 'format-yaml',
'pipe-format' => 'json',
],
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
];
return $items;
}