You are here

function deploy_auto_plan_set_session in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 modules/deploy_auto_plan/deploy_auto_plan.module \deploy_auto_plan_set_session()

Helper function to set a session value

Parameters

string: The plan name.

1 call to deploy_auto_plan_set_session()
deploy_adhoc_plan_init in modules/deploy_adhoc_plan/deploy_adhoc_plan.module
Implements hook_init().

File

modules/deploy_auto_plan/deploy_auto_plan.module, line 26
Deploy Auto Plan module functions.

Code

function deploy_auto_plan_set_session($value) {

  // Because the Drupal 7 testing framework is not the greatest this world have
  // seen we need to provide an alternative "session storage" in order to test
  // this. The regular sessions are messed up for some reason.
  // This is very hacky and will not work for all test cases, but it does the
  // job for now.
  $test_info =& $GLOBALS['drupal_test_info'];
  if ($test_info) {
    variable_set('deploy_auto_plan_user_plan__testing', $value);
    return;
  }
  $_SESSION['deploy_auto_plan_user_plan'] = $value;
}