You are here

xautoload.install in X Autoload 7.4

Same filename and directory in other branches
  1. 7.5 xautoload.install
  2. 7.3 xautoload.install

File

xautoload.install
View source
<?php

/**
 * Implements hook_install()
 */
function xautoload_install() {

  // Set module weight for xautoload to run before other modules.
  db_query("UPDATE {system} SET weight = -90 WHERE name = 'xautoload' AND type = 'module'");
}

/**
 * Implements hook_uninstall()
 */
function xautoload_uninstall() {
  variable_del('xautoload_cache_mode');
}

/**
 * Implements hook_enable()
 */
function xautoload_enable() {

  // This could be a process of enabling multiple modules.
  // The database does not have these other modules as enabled yet.
  // So we get them from the stack trace.
  $trace = debug_backtrace(0);
  if (1 && isset($trace[3]['function']) && 'module_enable' === $trace[3]['function'] && is_array($trace[3]['args'][0]) && !empty($trace[3]['args'][0])) {
    $modules = array_unique($trace[3]['args'][0]);
    xautoload()->extensionRegistrationService
      ->registerExtensionsByName($modules, 'module');
  }
}

/**
 * Implements hook_update_N()
 */
function xautoload_update_7000() {

  // Set module weight for xautoload to run before other modules.
  db_query("UPDATE {system} SET weight = -90 WHERE name = 'xautoload' AND type = 'module'");
}