system_status

5.x system.module system_status()
4.x system.module system_status()

Implementation of hook_status Expected return is array( "severity" => "normal" or "warning" or "alert", "status" => "A message to display to the user.", );

File

modules/system/system.module, line 1435

Code

function system_status() {
  $rtn = array();
  $rtn["severity"] = "normal";
  // Check on the last time cron was run; make sure it's working properly.
  $last_run = variable_get("cron_last_run", 0);

  // Report on current details about FlightPath.
  $rtn["status"] .= "<p>" . t("FlightPath version:") . " " . FLIGHTPATH_CORE . "-" . FLIGHTPATH_VERSION . "</p>";

  if ($last_run < strtotime("-2 DAY")) {
    $rtn["severity"] = "alert";
    $rtn["status"] .= t("Cron hasn't run in over 2 days.  For your installation of FlightPath
               to function properly, cron.php must be accessed routinely. At least once per day is recommended.");
  }
  else {
    $rtn["status"] .= t("Cron was last run on %date", array("%date" => format_date($last_run)));
  }

  $rtn["status"] .= "<p style='font-size: 0.8em;'>" . t("Your site's cron URL is:");
  $rtn["status"] .= "<br>&nbsp; &nbsp; <i>" . $GLOBALS["fp_system_settings"]["base_url"] . "/cron.php?t=" . $GLOBALS["fp_system_settings"]["cron_security_token"] . "</i>
                        <br>" . t("Example linux cron command:") . "&nbsp; <i>wget -O - -q -t 1 http://ABOVE_URL</i>";
  $rtn["status"] .= "</p>";


  return $rtn;

}