+if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') )
+ die();
+
+/**
+ * Tell WordPress we are doing the CRON task.
+ *
+ * @var bool
+ */
+define('DOING_CRON', true);
+
+if ( !defined('ABSPATH') ) {
+ /** Set up WordPress environment */
+ require_once('./wp-load.php');
+}
+
+// Uncached doing_cron transient fetch
+function _get_cron_lock() {
+ global $_wp_using_ext_object_cache, $wpdb;
+
+ $value = 0;
+ if ( $_wp_using_ext_object_cache ) {
+ // Skip local cache and force refetch of doing_cron transient in case
+ // another processs updated the cache
+ $value = wp_cache_get( 'doing_cron', 'transient', true );
+ } else {
+ $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) );
+ if ( is_object( $row ) )
+ $value = $row->option_value;
+ }
+
+ return $value;
+}
+
+if ( false === $crons = _get_cron_array() )
+ die();
+
+$keys = array_keys( $crons );
+$local_time = microtime( true );