Commit 4614ec7f authored by young hahn's avatar young hahn
Browse files

Updating drush command.

parent 39f64eb7
......@@ -31,23 +31,19 @@ function strongarm_drush_command() {
function strongarm_drush_export() {
$vars = func_get_args();
if (empty($vars)) {
// Pull all variables from DB.
$result = db_query('SELECT name FROM variable');
$variables = array();
while ($variable = db_fetch_object($result)) {
$variables[$variable->name] = $variable->name;
}
// Pull all variables defined in hook_strongarm(), merge them in.
$strongarmed = drupal_map_assoc(array_keys(strongarm_get_conf(TRUE, TRUE)));
$variables = $variables + $strongarmed;
ksort($variables);
// Output result, flag strongarmed variables.
$rows = array(array('Strongarmed', 'Variable name'));
foreach ($variables as $variable) {
$flag = $strongarmed[$variable] ? '*' : '';
$rows[] = array($flag, $variable);
ctools_include('export');
$rows = array(array('Variable name', 'Storage'));
$vars = ctools_export_load_object('variable');
ksort($vars);
foreach ($vars as $name => $variable) {
$default = ctools_get_default_object('variable', $name);
if ($variable->export_type & EXPORT_IN_CODE) {
$storage = ($variable->value != $default->value) ? 'Overridden' : 'Default';
}
else {
$storage = ''; // We could print 'Normal' here but this will just add visual noise.
}
$rows[] = array($name, $storage);
}
drush_print_table($rows, TRUE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment