You are here

minifyhtml.install in Minify Source HTML 8

Install and update hooks for the Minify HTML module.

File

minifyhtml.install
View source
<?php

/**
 * @file
 * Install and update hooks for the Minify HTML module.
 */

/**
 * Set the default value of the strip_comments configuration variable.
 */
function minifyhtml_update_8001() {
  \Drupal::service('config.factory')
    ->getEditable('minifyhtml.config')
    ->set('strip_comments', 1)
    ->save();
}

/**
 * Copy the configuration values to the new config.
 */
function minifyhtml_update_8002() {
  \Drupal::service('config.factory')
    ->getEditable('minifyhtml.config')
    ->set('minify', (bool) \Drupal::config('system.performance')
    ->get('minifyhtml.minify_html'))
    ->save();
  \Drupal::service('config.factory')
    ->getEditable('system.performance')
    ->clear('minifyhtml')
    ->save();
}

Functions

Namesort descending Description
minifyhtml_update_8001 Set the default value of the strip_comments configuration variable.
minifyhtml_update_8002 Copy the configuration values to the new config.