forked from DBCDK/ding_entity
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathding_entity.drush.inc
More file actions
37 lines (32 loc) · 847 Bytes
/
ding_entity.drush.inc
File metadata and controls
37 lines (32 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* @file
* Ding_entity's drush integration.
*/
/**
* Implements hook_drush_command().
*/
function ding_entity_drush_command() {
$items['ding-entity-update'] = array(
'description' => 'Update all entity fields.',
);
return $items;
}
function drush_ding_entity_update() {
$modules = array();
foreach (module_list() as $module) {
// Hook should be defined in install file.
module_load_install($module);
if (module_hook($module, 'ding_entity_fields')) {
$modules[] = $module;
}
}
if ($modules) {
ding_entity_modules_disabled($modules);
ding_entity_modules_enabled($modules);
drush_log(dt('Updated fields from modules: @modules', array('@modules' => implode(', ', $modules))), 'ok');
}
else {
drush_log(dt('No modules implement hook_ding_entity_fields.'), 'error');
}
}