Formatting and eol fixes.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2006-04-06 05:25:50 +00:00
parent 8aa385cf3f
commit ecb3101f4e
1 changed files with 57 additions and 55 deletions

View File

@ -1,4 +1,5 @@
<?php
function wp_schedule_single_event( $timestamp, $hook ) {
$args = array_slice( func_get_args(), 2 );
$crons = get_option( 'cron' );
@ -6,6 +7,7 @@ function wp_schedule_single_event($timestamp, $hook) {
ksort( $crons );
update_option( 'cron', $crons );
}
function wp_schedule_event( $timestamp, $recurrence, $hook ) {
$args = array_slice( func_get_args(), 3 );
$crons = get_option( 'cron' );
@ -17,7 +19,6 @@ function wp_schedule_event($timestamp, $recurrence, $hook) {
update_option( 'cron', $crons );
}
function wp_reschedule_event( $timestamp, $recurrence, $hook ) {
$args = array_slice( func_get_args(), 3 );
$crons = get_option( 'cron' );
@ -34,9 +35,9 @@ function wp_reschedule_event($timestamp, $recurrence, $hook) {
if ( 0 == $interval )
return false;
while($timestamp < time() + 1) {
while ( $timestamp < time() + 1 )
$timestamp += $interval;
}
wp_schedule_event( $timestamp, $recurrence, $hook );
}
@ -57,15 +58,15 @@ function wp_next_scheduled($hook) {
$crons = get_option( 'cron' );
if ( empty($crons) )
return false;
foreach($crons as $timestamp => $cron) {
//if($timestamp <= time()) continue;
if(isset($cron[$hook])) return $timestamp;
}
foreach ( $crons as $timestamp => $cron )
if ( isset( $cron[$hook] ) )
return $timestamp;
return false;
}
function spawn_cron() {
if (array_shift(array_keys(get_option('cron'))) > time()) return;
if ( array_shift( array_keys( get_option( 'cron' ) ) ) > time() )
return;
$cron_url = get_settings( 'siteurl' ) . '/wp-cron.php';
$parts = parse_url( $cron_url );
@ -102,4 +103,5 @@ function wp_get_schedules() {
);
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
}
?>