Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
33fe4c1d
Commit
33fe4c1d
authored
Sep 21, 2011
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#1008250
by jhodgdon, bxtaylor: clean up hook_init() and hook_boot() doc.
parent
35c400c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
modules/system/system.api.php
modules/system/system.api.php
+14
-10
No files found.
modules/system/system.api.php
View file @
33fe4c1d
...
...
@@ -672,8 +672,8 @@ function hook_element_info_alter(&$type) {
* page logging and specialized cleanup. This hook MUST NOT print anything.
*
* Only use this hook if your code must run even for cached page views.
* If you have code which must run once on all non
cached pages, use
* hook_init
instead. That
s the usual case. If you implement this hook
* If you have code which must run once on all non
-
cached pages, use
* hook_init
() instead. That i
s the usual case. If you implement this hook
* and see an error like 'Call to undefined function', it is likely that
* you are depending on the presence of a module which has not been loaded yet.
* It is not loaded because Drupal is still in bootstrap mode.
...
...
@@ -1744,32 +1744,36 @@ function hook_forms($form_id, $args) {
}
/**
* Perform setup tasks
. See also, hook_init
.
* Perform setup tasks
for all page requests
.
*
* This hook is run at the beginning of the page request. It is typically
* used to set up global parameters
which
are needed later in the request.
* used to set up global parameters
that
are needed later in the request.
*
* Only use this hook if your code must run even for cached page views.
This hook
* is called before modules or most include files are loaded into memory.
* Only use this hook if your code must run even for cached page views.
This
*
hook
is called before modules or most include files are loaded into memory.
* It happens while Drupal is still in bootstrap mode.
*
* @see hook_init()
*/
function
hook_boot
()
{
//
we need user_access() in the shutdown function. make sure it gets loaded
//
We need user_access() in the shutdown function. Make sure it gets loaded.
drupal_load
(
'module'
,
'user'
);
drupal_register_shutdown_function
(
'devel_shutdown'
);
}
/**
* Perform setup tasks
. See also, hook_boot
.
* Perform setup tasks
for non-cached page requests
.
*
* This hook is run at the beginning of the page request. It is typically
* used to set up global parameters
which
are needed later in the request.
*
w
hen this hook is called, all modules are already loaded in memory.
* used to set up global parameters
that
are needed later in the request.
*
W
hen this hook is called, all modules are already loaded in memory.
*
* This hook is not run on cached pages.
*
* To add CSS or JS that should be present on all pages, modules should not
* implement this hook, but declare these files in their .info file.
*
* @see hook_boot()
*/
function
hook_init
()
{
// Since this file should only be loaded on the front page, it cannot be
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment