function quickupdate_load_missing_dependencies in Quick update 8
Same name and namespace in other branches
- 7 quickupdate.module \quickupdate_load_missing_dependencies()
Loads all missing dependency projects.
Parameters
string $project_name: The short name of the project or leave empty. If empty, then loads all dependency projects. Otherwise, only loads the dependency projects of the specific project.
Return value
array An array that contains the missing dependency project's title, installed version, and recommended version.
2 calls to quickupdate_load_missing_dependencies()
- drush_quickupdate_qup_missing_dependencies in ./
quickupdate.drush.inc - Command handler. Downloads missing dependency projects.
- quickupdate_form_update_manager_update_form_alter in ./
quickupdate.module - Implements hook_form_FORM_ID_alter().
File
- ./
quickupdate.module, line 582 - Primarily Drupal hooks and global API functions.
Code
function quickupdate_load_missing_dependencies($project_name = '') {
// Resets the modules cache.
drupal_static('system_rebuild_module_data', NULL, TRUE);
// Resets the themes cache.
drupal_static('system_rebuild_theme_data', NULL, TRUE);
$module_files = system_rebuild_module_data();
$theme_files = system_rebuild_theme_data();
$themes_list = list_themes(TRUE);
$entry = array();
foreach ($module_files as $module) {
if (!empty($project_name) && $project_name != $module->name) {
continue;
}
foreach ($module->requires as $requires => $v) {
if (!isset($module_files[$requires]) && $requires != '_missing_dependency') {
$entry[$requires] = array(
'title' => drupal_ucfirst($requires),
'installed_version' => t('None'),
'recommended_version' => t('Unknown'),
);
}
}
}
foreach ($theme_files as $theme) {
if (!empty($project_name) && $project_name != $theme->name) {
continue;
}
if (isset($theme->base_themes)) {
foreach ($theme->base_themes as $short_name => $v) {
if (!array_key_exists($short_name, $themes_list)) {
$entry[$short_name] = array(
'title' => drupal_ucfirst($short_name),
'installed_version' => t('None'),
'recommended_version' => t('Unknown'),
);
}
}
}
}
return $entry;
}