Skip to content
Snippets Groups Projects
Commit c89a333f authored by Romanos Dodopoulos's avatar Romanos Dodopoulos
Browse files

Init - remove centrally managed modules

from the update manager.

Related to DRUPAL-141.
parents
No related branches found
No related tags found
No related merge requests found
# CERN Integration module
Custom functionality and constraints for CERN Drupal 8 infrastructure
name: CERN Integration module
description: Custom functionality and constraints for CERN Drupal infrastructure
package: CERN
type: module
version: '8.0.1'
core: 8.x
<?php
function cern_integration_install() {
drupal_set_message(t('CERN Integration module installed successfully.'));
}
function cern_integration_uninstall() {
drupal_set_message(t('CERN Integration module was uninstalled successfully.'));
}
<?php
function cern_integration_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
drupal_set_message(t("Form ID: $form_id"), "status");
}
/**
* Implements hook_update_projects_alter().
* Remove Drupal core as well as all centrally managed modules and themes from the Update manager.
*/
function cern_integration_update_projects_alter(&$projects)
{
// Remove Drupal core.
unset($projects['drupal']);
// Remove all centrally managed modules.
foreach (system_get_info("module") as $module_name => $module) {
if (preg_match('#^modules/#', drupal_get_path("module", $module_name))) {
if (isset($module["project"])){
unset($projects[$module["project"]]);
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment