function opigno_ilt_update_8004 in Opigno Instructor-led Trainings 8
Creates create cronjobs.
File
- ./
opigno_ilt.install, line 104 - Install, update and uninstall functions for the Opigno ILT module.
Code
function opigno_ilt_update_8004() {
// Enable new module opigno_cron.
if (!\Drupal::moduleHandler()
->moduleExists('opigno_cron')) {
\Drupal::service('module_installer')
->install([
'opigno_cron',
]);
}
// Add new cron configuretions.
$config_path = drupal_get_path('module', 'opigno_ilt') . '/config/install';
$storage = new FileStorage($config_path);
$config_storage = \Drupal::service('config.storage');
$data = $storage
->read('ultimate_cron.job.opigno_ilt_cron');
$config_storage
->write('ultimate_cron.job.opigno_ilt_cron', $data);
}