drupal_cron

Versions
4.6 – 5
drupal_cron()

Implementation of hook_cron(); handles pings to and from the site.

Code

modules/drupal.module, line 53

<?php
function drupal_cron() {
  if (time() - variable_get('drupal_cron_last', 0) > 21600) {
    variable_set('drupal_cron_last', time());

    // If this site acts as a Drupal XML-RPC server, delete the sites that
    // stopped sending "ping" messages.
    db_query("DELETE FROM {directory} WHERE timestamp < '". (time() - 259200) ."'");

    // If this site acts as a Drupal XML-RPC client, send a message to the
    // Drupal XML-RPC server.
    if (variable_get('drupal_directory', 0) && variable_get('drupal_server', 0)) {
      drupal_notify(variable_get('drupal_server', ''));
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.