You are here

function _ultimate_cron_launch_poorman in Ultimate Cron 7.2

Postponable poormans cron launching.

Parameters

UltimateCronLauncher $launcher: The Ultimate Cron launcher to use for poormans cron.

int $postpone: The number of times to postpone via register_shutdown_function.

1 call to _ultimate_cron_launch_poorman()
ultimate_cron_exit in ./ultimate_cron.poorman.inc
Implements hook_exit().
1 string reference to '_ultimate_cron_launch_poorman'
ultimate_cron_exit in ./ultimate_cron.poorman.inc
Implements hook_exit().

File

./ultimate_cron.poorman.inc, line 168
Poormans cron functions.

Code

function _ultimate_cron_launch_poorman($launcher, $postpone = 0) {
  if ($postpone > 0) {
    register_shutdown_function(__FUNCTION__, $launcher, $postpone - 1);
    return;
  }

  // Poormans cron should run as anonymous, just like regular cron does.
  global $user;
  $original_user = $user;
  $user = drupal_anonymous_user();
  $launcher
    ->launchPoorman();
  $user = $original_user;
}