Changeset 1923
- Timestamp:
- 01/23/2009 12:24:07 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/bb-cron.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-cron.php
r1857 r1923 10 10 */ 11 11 12 ignore_user_abort( true);12 ignore_user_abort( true ); 13 13 14 14 /** … … 17 17 * @var bool 18 18 */ 19 define( 'DOING_CRON', true);19 define( 'DOING_CRON', true ); 20 20 21 21 /** Setup bbPress environment */ 22 require_once( './bb-load.php');22 require_once( './bb-load.php' ); 23 23 24 if ( $_GET['check'] != backpress_get_option( 'cron_check') )24 if ( $_GET['check'] != backpress_get_option( 'cron_check' ) ) { 25 25 exit; 26 } 26 27 27 if ( bb_get_option( 'doing_cron') > time() )28 if ( bb_get_option( 'doing_cron' ) > time() ) { 28 29 exit; 30 } 29 31 30 bb_update_option( 'doing_cron', time() + 30);32 bb_update_option( 'doing_cron', time() + 30 ); 31 33 32 34 $crons = _get_cron_array(); 33 $keys = array_keys( $crons);34 if ( !is_array($crons) || $keys[0] > time())35 $keys = array_keys( $crons ); 36 if ( !is_array( $crons ) || $keys[0] > time() ) { 35 37 return; 38 } 36 39 37 foreach ($crons as $timestamp => $cronhooks) { 38 if ($timestamp > time()) break; 39 foreach ($cronhooks as $hook => $keys) { 40 foreach ($keys as $key => $args) { 40 foreach ( $crons as $timestamp => $cronhooks ) { 41 if ( $timestamp > time() ) { 42 break; 43 } 44 foreach ( $cronhooks as $hook => $keys ) { 45 foreach ( $keys as $key => $args ) { 41 46 $schedule = $args['schedule']; 42 if ( $schedule != false) {43 $new_args = array( $timestamp, $schedule, $hook, $args['args']);44 call_user_func_array( array('BB_Cron', 'reschedule_event'), $new_args);47 if ( $schedule != false ) { 48 $new_args = array( $timestamp, $schedule, $hook, $args['args'] ); 49 call_user_func_array( 'wp_reschedule_event' , $new_args ); 45 50 } 46 wp_unschedule_event( $timestamp, $hook, $args['args']);47 do_action_ref_array( $hook, $args['args']);51 wp_unschedule_event( $timestamp, $hook, $args['args'] ); 52 do_action_ref_array( $hook, $args['args'] ); 48 53 } 49 54 } 50 55 } 51 56 52 bb_update_option('doing_cron', 0); 53 54 ?> 57 bb_update_option( 'doing_cron', 0 );
Note: See TracChangeset
for help on using the changeset viewer.