System module hook_init()
✓ Published0🌍 Public
Aalexfinnarn
Last edited Mar 7, 2018
Created on Mar 7, 2018
This example shows Drupal’s `system_init()` function managing CSS assets and database slave handling during each page request. It calls `drupal_add_css()` to load system stylesheets with specific groups and `every_page` flags, while also checking `path_is_admin()` for admin-only CSS. The code then examines `$_SESSION['ignore_slave_server']` against `REQUEST_TIME` to conditionally call `Database::ignoreTarget()`, temporarily disabling slave database servers to avoid read lag after writes. It concludes by invoking `system_add_module_assets()` to include assets declared in module `.info` files.
AI-generated description