Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Enable modules.
- * Normally we'd use master module for this but sometimes you can't run anything other than updb in production.
- */
- function mymodule_update_7001(&$sandbox) {
- $modules = array(
- 'mymodule_one',
- 'mymodule_two',
- 'mymodule_three',
- );
- if (!isset($sandbox['progress'])) {
- $sandbox['progress'] = 0;
- $sandbox['max'] = count($modules);
- }
- $module = $modules[$sandbox['progress']];
- module_enable(array($module));
- drupal_flush_all_caches();
- $sandbox['progress']++;
- $sandbox['#finished'] = $sandbox['progress'] / $sandbox['max'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement