Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created February 24, 2012 09:59
Show Gist options
  • Select an option

  • Save nfreear/1899879 to your computer and use it in GitHub Desktop.

Select an option

Save nfreear/1899879 to your computer and use it in GitHub Desktop.
Drupal 6.x content hack - Uptime responder (solutiongrove). Prevent Cron emails.
<?php
// Uptime responder.
/*
Prevent Cron emails, eg.
From: Cron Daemon <***@***st.net>
Subject: Cron <h***@***> wget -O - -q -t 1 http://path/to/cron
http://drupal.org/node/553430
*/
foreach(debug_backtrace() as $a) {
if ($a['function'] == 'drupal_cron_run') {
return;
}
}
/*
http://uptime.solutiongrove.com/uptime/urls-for-user
*/
header("Content-Type: text/plain; utf-8");
?>
success
<?php exit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment