Cron fixes from mdawaffe. #2425

git-svn-id: http://svn.automattic.com/wordpress/trunk@3636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-03-08 05:51:42 +00:00
parent bc44b1b75d
commit 3f9714b97f
2 changed files with 9 additions and 5 deletions

View File

@ -3,6 +3,9 @@ ignore_user_abort(true);
define('DOING_CRON', TRUE);
require_once('wp-config.php');
if ( $_GET['check'] != md5(DB_PASS . '187425') )
exit;
$crons = get_option('cron');
if (!is_array($crons) || array_shift(array_keys($crons)) > time())
return;
@ -12,7 +15,6 @@ foreach ($crons as $timestamp => $cronhooks) {
do_action($hook, $args['args']);
$schedule = $args['schedule'];
if($schedule != false) {
fwrite($fp, var_export($schedules[$schedule]));
$args = array_merge( array($timestamp, $schedule, $hook), $args['args']);
call_user_func_array('wp_reschedule_event', $args);
}

View File

@ -49,7 +49,7 @@ function wp_unschedule_event($timestamp, $hook) {
}
function wp_clear_scheduled_hook($hook) {
while($timestamp = next_scheduled($hook))
while($timestamp = wp_next_scheduled($hook))
wp_unschedule_event($timestamp, $hook);
}
@ -72,8 +72,10 @@ function spawn_cron() {
$argyle = @ fsockopen($parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01);
if ( $argyle )
fputs($argyle, "GET {$parts['path']}?time=" . time() . '&check='
. md5(DB_PASS . '187425') . " HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\n\r\n");
fputs($argyle,
"GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n"
. "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n"
);
}
function wp_cron() {
@ -100,4 +102,4 @@ function wp_get_schedules() {
);
return array_merge(apply_filters('cron_schedules', array()), $schedules);
}
?>
?>