You are here

christmas_lights.install in Christmas Lights 8

Same filename and directory in other branches
  1. 7 christmas_lights.install

Install, update and uninstall functions for the Christmas Lights module.

File

christmas_lights.install
View 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

Namesort descending Description
christmas_lights_install Implements hook_install().