toolbar.install

Install, update and uninstall functions for the toolbar module.

File

drupal/core/modules/toolbar/toolbar.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the toolbar module.
 */

/**
 * Implements hook_schema().
 */
function toolbar_schema() {
  $schema['cache_toolbar'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_toolbar']['description'] = 'Cache table for the Toolbar module to store per-user hashes of rendered toolbar subtrees.';
  return $schema;
}

/**
 * @defgroup updates-7.x-to-8.x Updates from 7.x to 8.x
 * @{
 * Update functions from 7.x to 8.x.
 */

/**
 * Creates the {cache_toolbar} cache table.
 */
function toolbar_update_8000() {
  $schema['cache_toolbar'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_toolbar']['description'] = 'Cache table for the Toolbar module to store per-user hashes of rendered toolbar subtrees.';
  db_create_table('cache_toolbar', $schema['cache_toolbar']);
}

/**
 * Enable the Breakpoint and Config modules.
 *
 * The 7.x version of the Toolbar module had no dependencies. The 8.x version
 * depends on the Breakpoint and Configuration manager modules.
 */
function toolbar_update_8001() {

  // Enable the modules without re-installing the schema.
  update_module_enable(array(
    'breakpoint',
  ));
}

/**
 * @} End of "defgroup updates-7.x-to-8.x".
 * The next series of updates should start at 9000.
 */

Functions

Namesort descending Description
toolbar_schema Implements hook_schema().
toolbar_update_8000 Creates the {cache_toolbar} cache table.
toolbar_update_8001 Enable the Breakpoint and Config modules.