function update_status_perform_check
Search API
7.x update_status.module | update_status_perform_check() |
6.x update_status.module | update_status_perform_check() |
4.x update_status.module | update_status_perform_check() |
5.x update_status.module | update_status_perform_check() |
This function actually performs the update status check with getflightpath.com
2 calls to update_status_perform_check()
- update_status_check_now in modules/
update_status/ update_status.module - This will force a re-check of modules for this update_status module.
- update_status_cron in modules/
update_status/ update_status.module - Implementation of hook_cron()
File
- modules/
update_status/ update_status.module, line 51 - The update status module file.
Code
function update_status_perform_check() {
// Let's assemble our URL which should be fairly long.
$url = update_status_get_install_status_url();
$result = fp_http_request($url);
// We expect the $result to look like an object, where
// $result->data contains the returned HTML from the url,
// and $result->code contains the response code.
$response = trim($result->data);
// Response must contain the text "FLIGHTPATH_SUCCESS" for us to believe it is successful.
if (!strstr($response, "FLIGHTPATH_SUCCESS")) {
watchdog("update_status", "Checking update status failed.", array(), WATCHDOG_ERROR);
fp_add_message(t("Checking update status failed. Perhaps FlightPath cannot access external sites?"));
return;
}
// If we are here then we got back a valid response.
// Parse result and set variables where needed.
$res_array = array();
parse_str($response, $res_array);
// The modules which have different versions than what we have installed
// are in $res_array["modules"] and ["release_types"]
variable_set("update_status_need_updates_modules", $res_array ["modules"]);
variable_set("update_status_need_updates_release_types", $res_array ["release_types"]);
variable_set("update_status_last_run", time());
fp_add_message(t("Check of update status successful."));
}