[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/includes/ -> bootstrap.inc (summary)

(no description)

File Size: 1333 lines (42 kb)
Included or required: 13 times
Referenced: 0 times
Includes or requires: 6 files
 includes/language.inc
 includes/common.inc
 includes/path.inc
 includes/theme.maintenance.inc
 includes/module.inc
 includes/database.inc

Defines 36 functions

  timer_start()
  timer_read()
  timer_stop()
  conf_path()
  drupal_unset_globals()
  drupal_valid_http_host()
  conf_init()
  drupal_get_filename()
  variable_init()
  variable_get()
  variable_set()
  variable_del()
  page_get_cache()
  bootstrap_invoke_all()
  drupal_load()
  drupal_page_header()
  drupal_page_cache_header()
  bootstrap_hooks()
  drupal_unpack()
  referer_uri()
  check_plain()
  drupal_validate_utf8()
  request_uri()
  watchdog()
  drupal_set_message()
  drupal_get_messages()
  drupal_is_denied()
  drupal_anonymous_user()
  drupal_bootstrap()
  _drupal_bootstrap()
  drupal_maintenance_theme()
  get_t()
  drupal_init_language()
  language_list()
  language_default()
  ip_address()

Functions
Functions that are not part of a class:

timer_start($name)   X-Ref
Start the timer with the specified name. If you start and stop
the same timer multiple times, the measured intervals will be
accumulated.

param: name

timer_read($name)   X-Ref
Read the current timer value without stopping the timer.

param: name
return:

timer_stop($name)   X-Ref
Stop the timer with the specified name.

param: name
return:

conf_path($require_settings = TRUE, $reset = FALSE)   X-Ref
Find the appropriate configuration directory.

Try finding a matching configuration directory by stripping the website's
hostname from left to right and pathname from right to left. The first
configuration file found will be used; the remaining will ignored. If no
configuration file is found, return a default value '$confdir/default'.

Example for a fictitious site installed at
http://www.drupal.org:8080/mysite/test/ the 'settings.php' is searched in
the following directories:

1. $confdir/8080.www.drupal.org.mysite.test
2. $confdir/www.drupal.org.mysite.test
3. $confdir/drupal.org.mysite.test
4. $confdir/org.mysite.test

5. $confdir/8080.www.drupal.org.mysite
6. $confdir/www.drupal.org.mysite
7. $confdir/drupal.org.mysite
8. $confdir/org.mysite

9. $confdir/8080.www.drupal.org
10. $confdir/www.drupal.org
11. $confdir/drupal.org
12. $confdir/org

13. $confdir/default

param: $require_settings
param: reset
return:

drupal_unset_globals()   X-Ref
Unsets all disallowed global variables. See $allowed for what's allowed.


drupal_valid_http_host($host)   X-Ref
Validate that a hostname (for example $_SERVER['HTTP_HOST']) is safe.

As $_SERVER['HTTP_HOST'] is user input, ensure it only contains characters
allowed in hostnames.  See RFC 952 (and RFC 2181). $_SERVER['HTTP_HOST'] is
lowercased.

return:

conf_init()   X-Ref
Loads the configuration and sets the base URL, cookie domain, and
session name correctly.


drupal_get_filename($type, $name, $filename = NULL)   X-Ref
Returns and optionally sets the filename for a system item (module,
theme, etc.). The filename, whether provided, cached, or retrieved
from the database, is only returned if the file exists.

This function plays a key role in allowing Drupal's resources (modules
and themes) to be located in different places depending on a site's
configuration. For example, a module 'foo' may legally be be located
in any of these three places:

modules/foo/foo.module
sites/all/modules/foo/foo.module
sites/example.com/modules/foo/foo.module

Calling drupal_get_filename('module', 'foo') will give you one of
the above, depending on where the module is located.

param: $type
param: $name
param: $filename
return:

variable_init($conf = array()   X-Ref
Load the persistent variable table.

The variable table is composed of values that have been saved in the table
with variable_set() as well as those explicitly specified in the configuration
file.

variable_get($name, $default)   X-Ref
Returns a persistent variable.

Case-sensitivity of the variable_* functions depends on the database
collation used. To avoid problems, always use lower case for persistent
variable names.

param: $name
param: $default
return:

variable_set($name, $value)   X-Ref
Sets a persistent variable.

Case-sensitivity of the variable_* functions depends on the database
collation used. To avoid problems, always use lower case for persistent
variable names.

param: $name
param: $value

variable_del($name)   X-Ref
Unsets a persistent variable.

Case-sensitivity of the variable_* functions depends on the database
collation used. To avoid problems, always use lower case for persistent
variable names.

param: $name

page_get_cache($status_only = FALSE)   X-Ref
Retrieve the current page from the cache.

Note: we do not serve cached pages when status messages are waiting (from
a redirected form submission which was completed).

param: $status_only

bootstrap_invoke_all($hook)   X-Ref
Call all init or exit hooks without including all modules.

param: $hook

drupal_load($type, $name)   X-Ref
Includes a file with the provided type and name. This prevents
including a theme, engine, module, etc., more than once.

param: $type
param: $name
return:

drupal_page_header()   X-Ref
Set HTTP headers in preparation for a page response.

Authenticated users are always given a 'no-cache' header, and will
fetch a fresh page on every request.  This prevents authenticated
users seeing locally cached pages that show them as logged out.


drupal_page_cache_header($cache)   X-Ref
Set HTTP headers in preparation for a cached page response.

The general approach here is that anonymous users can keep a local
cache of the page, but must revalidate it on every request.  Then,
they are given a '304 Not Modified' response as long as they stay
logged out and the page has not been modified.


bootstrap_hooks()   X-Ref
Define the critical hooks that force modules to always be loaded.


drupal_unpack($obj, $field = 'data')   X-Ref
Unserializes and appends elements from a serialized string.

param: $obj
param: $field

referer_uri()   X-Ref
Return the URI of the referring page.


check_plain($text)   X-Ref
Encode special characters in a plain-text string for display as HTML.

Also validates strings as UTF-8 to prevent cross site scripting attacks on
Internet Explorer 6.

param: $text
return:

drupal_validate_utf8($text)   X-Ref
Checks whether a string is valid UTF-8.

All functions designed to filter input should use drupal_validate_utf8
to ensure they operate on valid UTF-8 strings to prevent bypass of the
filter.

When text containing an invalid UTF-8 lead byte (0xC0 - 0xFF) is presented
as UTF-8 to Internet Explorer 6, the program may misinterpret subsequent
bytes. When these subsequent bytes are HTML control characters such as
quotes or angle brackets, parts of the text that were deemed safe by filters
end up in locations that are potentially unsafe; An onerror attribute that
is outside of a tag, and thus deemed safe by a filter, can be interpreted
by the browser as if it were inside the tag.

This function exploits preg_match behaviour (since PHP 4.3.5) when used
with the u modifier, as a fast way to find invalid UTF-8. When the matched
string contains an invalid byte sequence, it will fail silently.

preg_match may not fail on 4 and 5 octet sequences, even though they
are not supported by the specification.

The specific preg_match behaviour is present since PHP 4.3.5.

param: $text
return:

request_uri()   X-Ref
Since $_SERVER['REQUEST_URI'] is only available on Apache, we
generate an equivalent using other environment variables.


watchdog($type, $message, $variables = array()   X-Ref
Log a system message.

param: $type
param: $message
param: $variables
param: $severity
param: $link

drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE)   X-Ref
Set a message which reflects the status of the performed operation.

If the function is called with no arguments, this function returns all set
messages without clearing them.

param: $message
param: $type
param: $repeat

drupal_get_messages($type = NULL, $clear_queue = TRUE)   X-Ref
Return all messages that have been set.

param: $type
param: $clear_queue
return:

drupal_is_denied($type, $mask)   X-Ref
Perform an access check for a given mask and rule type. Rules are usually
created via admin/user/rules page.

If any allow rule matches, access is allowed. Otherwise, if any deny rule
matches, access is denied.  If no rule matches, access is allowed.

param: $type string
param: $mask string
return: bool

drupal_anonymous_user($session = '')   X-Ref
Generates a default anonymous $user object.

return: Object - the user object.

drupal_bootstrap($phase)   X-Ref
A string describing a phase of Drupal to load. Each phase adds to the
previous one, so invoking a later phase automatically runs the earlier
phases too. The most important usage is that if you want to access the
Drupal database from a script without loading anything else, you can
include bootstrap.inc, and call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE).

param: $phase

_drupal_bootstrap($phase)   X-Ref
No description

drupal_maintenance_theme()   X-Ref
Enables use of the theme system without requiring database access.

Loads and initializes the theme system for site installs, updates and when
the site is in off-line mode. This also applies when the database fails.


get_t()   X-Ref
Return the name of the localisation function. Use in code that needs to
run both during installation and normal operation.


drupal_init_language()   X-Ref
Choose a language for the current page, based on site and user preferences.


language_list($field = 'language', $reset = FALSE)   X-Ref
Get a list of languages set up indexed by the specified key

param: $field The field to index the list with.
param: $reset Boolean to request a reset of the list.

language_default($property = NULL)   X-Ref
Default language used on the site

param: $property

ip_address()   X-Ref
If Drupal is behind a reverse proxy, we use the X-Forwarded-For header
instead of $_SERVER['REMOTE_ADDR'], which would be the IP address
of the proxy server, and not the client's.

return:



Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7