function system_status

6.x system.module system_status()
4.x system.module system_status()
5.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 3059

Code

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

  // Report on current details about FlightPath.
  $fpversion = FLIGHTPATH_VERSION;
  if ($fpversion == "%FP_VERSION%") {
    // This means you are using a version not downloaded from getflightpath.com.  Probably directly from a git repository.
    $fpversion = "GitRepo";
  }
  $rtn ["status"] .= "<p>" . t("FlightPath version:") . " " . FLIGHTPATH_CORE . "-" . $fpversion . "</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.  
               Set for more frequently if making use of text messaging, emails, or notifications in FlightPath.  
               For example, every 10 minutes.");
  }
  else {
    $rtn ["status"] .= t("Cron was last run on %date", array("%date" => format_date($last_run)));
  }

  $cron_url = $GLOBALS ["fp_system_settings"]["base_url"] . "/cron.php?t=" . $GLOBALS ["fp_system_settings"]["cron_security_token"];

  $rtn ["status"] .= "<p style='font-size: 0.8em;'>" . t("Your site's cron URL is:");
  $rtn ["status"] .= "&nbsp; <i>" . $cron_url . "</i>
                        <br>" . t("Ex linux cron command (every 10 min):") . "&nbsp; <i style='background-color: beige;'>*/10 * * * * wget -O - -q -t 1 $cron_url</i>";
  $rtn ["status"] .= "</p>";


  return $rtn;

}