-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.drush.inc
53 lines (47 loc) · 1.45 KB
/
kernel.drush.inc
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @file
* Drush wrapper around the Composer package management system.
*
* @author Rob Loach (http://robloach.net)
*/
/**
* Implementation of hook_drush_command().
*/
function kernel_drush_command() {
$items['app'] = array(
'description' => 'Perform package management and dependency tracking of your projects and libraries.',
'arguments' => array(
'command' => 'Run "drush app" for a list of available commands.',
),
'allow-additional-options' => TRUE,
'examples' => array(
'drush app' => 'Display available commands available with Application.',
),
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
);
return $items;
}
/**
* Drush Composer; Invokes a Composer command.
*
* @param $command
* The Composer command we are to execute.
*/
function drush_kernel_app($command = '') {
// Make sure the PHP requirements are met.
$php = '5.3.2';
$current = phpversion();
if (version_compare($current, $php, '<')) {
drush_set_error('DRUSH_APPLICATION_ERROR', dt('Composer requires at least PHP !php in order to run properly. You are currently on PHP !current.', array(
'!php' => $php,
'!current' => $current,
)));
return FALSE;
}
// Include the run in a different file so that PHP versions < 5.3 do not fail
// parsing the file.
require_once(__DIR__ .'/kernel.drush.run.inc');
// Run the console command using the given function arguments.
return drush_kernel_app_run(func_get_args());
}