christmas_lights.install in Christmas Lights 8
Same filename and directory in other branches
Install, update and uninstall functions for the Christmas Lights module.
File
christmas_lights.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Christmas Lights module.
*/
/**
* Implements hook_install().
*/
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();
}
Functions
Name | Description |
---|---|
christmas_lights_install | Implements hook_install(). |