bootstrap.inc

Version 1.364 (checked in on 2010/03/21 at 16:51:26 by webchick)

Functions that need to be loaded on every Drupal request.

Constants

NameDescription
CACHE_DISABLEDIndicates that page caching is disabled.
CACHE_NORMALIndicates that page caching is enabled, using "normal" mode.
CACHE_PERMANENTIndicates that the item should never be removed unless explicitly selected.
CACHE_TEMPORARYIndicates that the item should be removed at the next general cache wipe.
CHECK_PLAINFlag for drupal_set_title(); text is not sanitized, so run check_plain().
DRUPAL_ANONYMOUS_RIDRole ID for anonymous users; should match what's in the "role" table.
DRUPAL_AUTHENTICATED_RIDRole ID for authenticated users; should match what's in the "role" table.
DRUPAL_BOOTSTRAP_CONFIGURATIONFirst bootstrap phase: initialize configuration.
DRUPAL_BOOTSTRAP_DATABASEThird bootstrap phase: initialize database layer.
DRUPAL_BOOTSTRAP_FULLFinal bootstrap phase: Drupal is fully loaded; validate and fix input data.
DRUPAL_BOOTSTRAP_LANGUAGESeventh bootstrap phase: find out language of the page.
DRUPAL_BOOTSTRAP_PAGE_CACHESecond bootstrap phase: try to serve a cached page.
DRUPAL_BOOTSTRAP_PAGE_HEADERSixth bootstrap phase: set up the page header.
DRUPAL_BOOTSTRAP_SESSIONFifth bootstrap phase: initialize session handling.
DRUPAL_BOOTSTRAP_VARIABLESFourth bootstrap phase: initialize the variable system.
DRUPAL_CORE_COMPATIBILITYCore API compatibility.
DRUPAL_KILOBYTEThe number of bytes in a kilobyte. For more information, visit http://en.wikipedia.org/wiki/Kilobyte.
DRUPAL_MINIMUM_MYSQLMinimum supported version of MySQL, if it is used.
DRUPAL_MINIMUM_PGSQLMinimum supported version of PostgreSQL, if it is used.
DRUPAL_MINIMUM_PHPMinimum supported version of PHP.
DRUPAL_MINIMUM_PHP_MEMORY_LIMITMinimum recommended value of PHP memory_limit.
LANGUAGE_LTRLanguage written left to right. Possible value of $language->direction.
LANGUAGE_NONEThe language code used when no language is explicitly assigned.
LANGUAGE_RTLLanguage written right to left. Possible value of $language->direction.
LANGUAGE_TYPE_CONTENTThe type of language used to define the content language.
LANGUAGE_TYPE_INTERFACEThe type of language used to select the user interface.
LANGUAGE_TYPE_URLThe type of language used for URLs.
PASS_THROUGHFlag for drupal_set_title(); text has already been sanitized.
REGISTRY_RESET_LOOKUP_CACHESignals that the registry lookup cache should be reset.
REGISTRY_WRITE_LOOKUP_CACHESignals that the registry lookup cache should be written to storage.
REQUEST_TIMEFor convenience, define a short form of the request time global.
VERSIONThe current system version.
WATCHDOG_ALERTLog message severity -- Alert: action must be taken immediately.
WATCHDOG_CRITICALLog message severity -- Critical: critical conditions.
WATCHDOG_DEBUGLog message severity -- Debug: debug-level messages.
WATCHDOG_EMERGENCYLog message severity -- Emergency: system is unusable.
WATCHDOG_ERRORLog message severity -- Error: error conditions.
WATCHDOG_INFOLog message severity -- Informational: informational messages.
WATCHDOG_NOTICELog message severity -- Notice: normal but significant condition.
WATCHDOG_WARNINGLog message severity -- Warning: warning conditions.

Functions

NameDescription
bootstrap_hooksDefine the critical hooks that force modules to always be loaded.
bootstrap_invoke_allCall all init or exit hooks without including all modules.
check_plainEncode special characters in a plain-text string for display as HTML.
conf_pathFind the appropriate configuration directory.
drupal_add_http_headerSet an HTTP response header for the current page.
drupal_anonymous_userGenerates a default anonymous $user object.
drupal_autoload_classConfirm that a class is available.
drupal_autoload_interfaceConfirm that an interface is available.
drupal_block_deniedHandle denied users.
drupal_bootstrapA 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...
drupal_environment_initializeInitialize PHP environment.
drupal_generate_test_uaGenerate a user agent string with a HMAC and timestamp for simpletest.
drupal_get_bootstrap_phaseReturns the current bootstrap phase for this Drupal process.
drupal_get_filenameReturns 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.
drupal_get_http_headerGet the HTTP response headers for the current page.
drupal_get_messagesReturn all messages that have been set.
drupal_get_schemaGet the schema definition of a table, or the whole database schema.
drupal_installation_attemptedReturn TRUE if a Drupal installation is currently being attempted.
drupal_is_cliDetect whether the current script is running in a command-line environment.
drupal_is_deniedCheck to see if an IP address has been blocked.
drupal_language_initializeInitialize all the defined language types.
drupal_language_typesThe built-in language types.
drupal_loadIncludes a file with the provided type and name. This prevents including a theme, engine, module, etc., more than once.
drupal_maintenance_themeEnables use of the theme system without requiring database access.
drupal_multilingualReturn true if there is more than one language enabled.
drupal_override_server_variablesSet appropriate server variables needed for command line scripts to work.
drupal_page_get_cacheRetrieve the current page from the cache.
drupal_page_headerSet HTTP headers in preparation for a page response.
drupal_page_is_cacheableDetermine the cacheability of the current page.
drupal_placeholderFormats text for emphasized display in a placeholder inside a sentence. Used automatically by t().
drupal_register_shutdown_functionRegister a function for execution on shutdown.
drupal_send_headersSend the HTTP response headers previously set using drupal_add_http_header(). Add default headers, unless they have been replaced or unset using drupal_add_http_header().
drupal_serve_page_from_cacheSet HTTP headers in preparation for a cached page response.
drupal_settings_initializeLoads the configuration and sets the base URL, cookie domain, and session name correctly.
drupal_set_messageSet a message which reflects the status of the performed operation.
drupal_staticCentral static variable storage.
drupal_static_resetReset one or all centrally stored static variable(s).
drupal_unpackUnserializes and appends elements from a serialized string.
drupal_validate_utf8Checks whether a string is valid UTF-8.
drupal_valid_http_hostValidate that a hostname (for example $_SERVER['HTTP_HOST']) is safe.
drupal_valid_test_uaValidate the HMAC and timestamp of a user agent header from simpletest.
get_tReturn the name of the localization function. Use in code that needs to run both during installation and normal operation.
ip_addressIf 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. The actual header name can be configured by the...
language_defaultDefault language used on the site
language_listGet a list of languages set up indexed by the specified key
language_typesReturn an array of the available language types.
registry_rebuildRescan all enabled modules and rebuild the registry.
registry_updateUpdate the registry based on the latest files listed in the database.
request_pathReturns the requested URL path of the page being viewed.
request_uriSince $_SERVER['REQUEST_URI'] is only available on Apache, we generate an equivalent using other environment variables.
tTranslate strings to the page language or a given language.
timer_readRead the current timer value without stopping the timer.
timer_startStart the timer with the specified name. If you start and stop the same timer multiple times, the measured intervals will be accumulated.
timer_stopStop the timer with the specified name.
variable_delUnset a persistent variable.
variable_getReturn a persistent variable.
variable_initializeLoad the persistent variable table.
variable_setSet a persistent variable.
watchdogLog a system message.
_drupal_bootstrap_configurationBootstrap configuration: Setup script environment and load settings.php.
_drupal_bootstrap_databaseBootstrap database: Initialize database system and register autoload functions.
_drupal_bootstrap_page_cacheBootstrap page cache: Try to serve a page from cache.
_drupal_bootstrap_page_headerBootstrap page header: Invoke hook_boot(), initialize locking system, and send default HTTP headers.
_drupal_bootstrap_variablesBootstrap variables: Load system variables and all enabled bootstrap modules.
_drupal_error_handlerCustom PHP error handler.
_drupal_exception_handlerCustom PHP exception handler.
_drupal_set_preferred_header_nameHeader names are case-insensitive, but for maximum compatibility they should follow "common form" (see RFC 2617, section 4.2).
_drupal_shutdown_functionInternal function used to execute registered shutdown functions.
_registry_check_codeHelper to check for a resource in the registry.