[ Index ]

PHP Cross Reference of Wordpress MU 2.7

title

Body

[close]

/ -> wp-cron.php (source)

   1  <?php
   2  /**
   3   * WordPress Cron Implementation for hosts, which do not offer CRON or for which
   4   * the user has not setup a CRON job pointing to this file.
   5   *
   6   * The HTTP request to this file will not slow down the visitor who happens to
   7   * visit when the cron job is needed to run.
   8   *
   9   * @package WordPress
  10   */
  11  
  12  ignore_user_abort(true);
  13  
  14  /**
  15   * Tell WordPress we are doing the CRON task.
  16   *
  17   * @var bool
  18   */
  19  define('DOING_CRON', true);
  20  /** Setup WordPress environment */
  21  require_once ('./wp-load.php');
  22  
  23  if ( $_GET['check'] != wp_hash('187425') )
  24      exit;
  25  
  26  $local_time = time();
  27  
  28  $crons = _get_cron_array();
  29  $keys = array_keys( $crons );
  30  
  31  if (!is_array($crons) || $keys[0] > $local_time) {
  32      update_option('doing_cron', 0);
  33      return;
  34  }
  35  
  36  foreach ($crons as $timestamp  => $cronhooks) {
  37  
  38      if ( $timestamp > $local_time )
  39          break;
  40  
  41      foreach ($cronhooks as $hook => $keys) {
  42  
  43          foreach ($keys as $k => $v) {
  44  
  45              $schedule = $v['schedule'];
  46  
  47              if ($schedule != false) {
  48                  $new_args = array($timestamp, $schedule, $hook, $v['args']);
  49                  call_user_func_array('wp_reschedule_event', $new_args);
  50              }
  51  
  52              wp_unschedule_event($timestamp, $hook, $v['args']);
  53  
  54               do_action_ref_array($hook, $v['args']);
  55          }
  56      }
  57  }
  58  
  59  update_option('doing_cron', 0);
  60  
  61  die();
  62  
  63  ?>


Generated: Thu Mar 5 12:05:07 2009 Cross-referenced by PHPXref 0.7