You are here

libraries.install in Libraries API 7.2

Same filename and directory in other branches
  1. 8.3 libraries.install
  2. 7.3 libraries.install

Install, uninstall, and update functions for libraries.module.

File

libraries.install
View source
<?php

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

/**
 * Implements hook_schema().
 */
function libraries_schema() {
  $schema['cache_libraries'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_libraries']['description'] = 'Cache table to store library information.';
  return $schema;
}

/**
 * Create the 'cache_libraries' table.
 */
function libraries_update_7200() {

  // Note that previous versions of this function created the table with a
  // different table comment.
  if (!db_table_exists('cache_libraries')) {
    $specs = libraries_schema();
    db_create_table('cache_libraries', $specs['cache_libraries']);
  }
}

/**
 * Rebuild the class registry.
 */
function libraries_update_7201() {

  // The tests were split from a single libraries.test file into multiple files
  // during the 7.x-2.x cycle.
  registry_rebuild();
}

/**
 * Grant the "View library reports" permission to roles with the "View site reports" permission.
 */
function libraries_update_7202() {
  $rids = array_keys(user_roles(FALSE, 'access site reports'));
  foreach ($rids as $rid) {
    _update_7000_user_role_grant_permissions($rid, array(
      'access library reports',
    ), 'libraries');
  }
}

Functions

Namesort descending Description
libraries_schema Implements hook_schema().
libraries_update_7200 Create the 'cache_libraries' table.
libraries_update_7201 Rebuild the class registry.
libraries_update_7202 Grant the "View library reports" permission to roles with the "View site reports" permission.