function christmas_lights_install in Christmas Lights 8
Same name and namespace in other branches
- 7 christmas_lights.install \christmas_lights_install()
Implements hook_install().
File
- ./
christmas_lights.install, line 11 - Install, update and uninstall functions for the Christmas Lights module.
Code
function christmas_lights_install() {
$settings = [
'enabled' => 0,
'start' => mktime(0, 0, 0, 12, 1, date('Y', Drupal::time()
->getRequestTime())),
'end' => mktime(0, 0, 0, 1, 15, date('Y', Drupal::time()
->getRequestTime()) + 1),
];
\Drupal::configFactory()
->getEditable('christmas_lights.settings')
->setData($settings)
->save();
}