1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Drush implementation for the uuid module.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implementats hook_drush_command().
|
10
|
*/
|
11
|
function uuid_drush_command() {
|
12
|
$items = array();
|
13
|
$items['uuid-create-missing'] = array(
|
14
|
'description' => 'Create missing UUIDs for enabled entities.',
|
15
|
'aliases' => array('uuid-create'),
|
16
|
);
|
17
|
return $items;
|
18
|
}
|
19
|
|
20
|
/**
|
21
|
* Implementats of hook_drush_help().
|
22
|
*/
|
23
|
function uuid_drush_help($section) {
|
24
|
switch ($section) {
|
25
|
case 'drush:uuid-create-missing':
|
26
|
return dt("This command will create missing UUIDs for those content types specified in the module settings for automatic generation.");
|
27
|
}
|
28
|
}
|
29
|
|
30
|
/**
|
31
|
* Drush command callback.
|
32
|
*/
|
33
|
function drush_uuid_create_missing() {
|
34
|
if (!drush_confirm(dt('Are you sure?'))) {
|
35
|
return drush_user_abort();
|
36
|
}
|
37
|
module_load_include('inc', 'uuid', 'uuid');
|
38
|
|
39
|
drush_log(dt('Beginning bulk creation of UUIDs.'), 'ok');
|
40
|
uuid_sync_all();
|
41
|
}
|