You are here

function hosting_task_hosting_tasks_alter in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 task/hosting_task.module \hosting_task_hosting_tasks_alter()

Implements hook_hosting_tasks_alter()

Set 'command' property for tasks that don't implement it.

File

task/hosting_task.module, line 887
Web server node type is defined here.

Code

function hosting_task_hosting_tasks_alter(&$cache) {

  // For any task type that doesn't use "command", add it as 'provision-$TYPE'.
  foreach ($cache as &$tasks) {
    foreach ($tasks as $type => &$task_type) {
      if (!isset($task_type['command']) || empty($task_type['command'])) {
        $task_type['command'] = 'provision-' . $type;
      }
    }
  }
}