xautoload.install in X Autoload 7.4
Same filename and directory in other branches
File
xautoload.installView 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'");
}
Functions
Name![]() |
Description |
---|---|
xautoload_enable | Implements hook_enable() |
xautoload_install | Implements hook_install() |
xautoload_uninstall | Implements hook_uninstall() |
xautoload_update_7000 | Implements hook_update_N() |