You are here

function deploy_add_to_plan in Deploy - Content Staging 6

Same name and namespace in other branches
  1. 5 deploy.module \deploy_add_to_plan()

Add an item to a deployment plan.

@todo This needs to be refactored such that a) it detects errors properly and b) it returns a bool rather than just going on.

Parameters

$pid: Unique identifier for the plan this item is being added to.

$module: The module that handles this "thing" being deployed.

$description: A text description of this item, to be displayed in the plan overview listing.

$data: The identifying data for this item (typically an ID, but it doesn't have to be.)

$weight: This item's weight within its group.

$weight_group: Group-centric weighting to control when the invidual modules are deployed. For more details see the comments for the constants defined at the top of this module.

17 calls to deploy_add_to_plan()
book_node_deploy_check in modules/book_deploy/book_deploy.module
Implementation of hook_node_deploy_check().
comment_deploy_check in modules/comment_deploy/comment_deploy.module
Implementation of hook_deploy_check().
comment_deploy_operations_add_form_submit in modules/comment_deploy/comment_deploy.pages.inc
Submit handler for comment_deploy_operations_add_form().
comment_deploy_operations_add_now_form_submit in modules/comment_deploy/comment_deploy.pages.inc
Submit handler for comment_deploy_operations_add_now_form().
content_copy_deploy_add_form_submit in modules/content_copy_deploy/content_copy_deploy.pages.inc
Deploy content type form submit callback.

... See full list

File

./deploy.module, line 317
Deployment API which enables modules to deploy items between servers.

Code

function deploy_add_to_plan($pid, $module, $description, $data, $weight = 0, $weight_group = 0) {
  global $user;
  if (!empty($data) && !empty($module) && !empty($pid)) {
    db_query("INSERT INTO {deploy_plan_items} (pid, uid, ts, module, description, data, weight, weight_group) VALUES (%d, %d, %d, '%s', '%s', '%s', %d, %d)", $pid, $user->uid, time(), $module, $description, $data, $weight, $weight_group);
  }
}