Commit 5ca47465 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Install dev tools automatically if settings.php has 'uw_dev_site' setting set TRUE

parent 6416e459
......@@ -6,6 +6,7 @@
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Site\Settings;
/**
* Implements hook_form_FORM_ID_alter() for install_configure_form().
......@@ -25,3 +26,25 @@ function uw_base_profile_form_install_configure_form_alter(&$form, FormStateInte
// Update notification defaults.
$form['update_notifications']['enable_update_status_emails']['#default_value'] = 0;
}
/**
* Implements hook_install_tasks().
*/
function uw_base_profile_install_tasks(&$install_state) {
$tasks['uw_base_profile_conditional_installs'] = array(
'display_name' => 'University of Waterloo conditional installs',
'type' => 'normal',
);
return $tasks;
}
/**
* Callback for uw_base_profile_conditional_installs task.
*/
function uw_base_profile_conditional_installs() {
$is_dev = Settings::get('uw_dev_site', FALSE);
if ($is_dev) {
$modules = array('uw_site_dev');
\Drupal::service('module_installer')->install($modules, TRUE);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment