_update_build_fetch_url
modules/update/update.fetch.inc, строка 106
- Версии
- 6
_update_build_fetch_url($project, $site_key = '')
Generates the URL to fetch information about project updates.
This figures out the right URL to use, based on the project's .info file and the global defaults. Appends optional query arguments when the site is configured to report usage stats.
Смотрите также
@see update_get_projects()
Параметры
$project
The array of project information from update_get_projects().
$site_key
The anonymous site key hash (optional).
Код
<?php
function _update_build_fetch_url($project, $site_key = '') {
$name = $project['name'];
$url = _update_get_fetch_url_base($project);
$url .= '/'. $name .'/'. DRUPAL_CORE_COMPATIBILITY;
// Only append a site_key and the version information if we have a site_key
// in the first place, and if this is not a disabled module or theme. We do
// not want to record usage statistics for disabled code.
if (!empty($site_key) && (strpos($project['project_type'], 'disabled') === FALSE)) {
$url .= (strpos($url, '?') === TRUE) ? '&' : '?';
$url .= 'site_key=';
$url .= drupal_urlencode($site_key);
if (!empty($project['info']['version'])) {
$url .= '&version=';
$url .= drupal_urlencode($project['info']['version']);
}
}
return $url;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии