Skip navigation
Help

globals.php

  1. drupal
    1. 6 documentation/developer/globals.php
    2. 7 documentation/developer/globals.php

These are the global variables that Drupal uses.

Globals

NameDescription
$active_dbActive database connection.
$base_pathThe base path of the drupal installation. At least will default to /.
$base_rootThe root URL of the host excludes the path.
$base_theme_infoAn array of objects that reperesent the base theme. For documentation of the theme object see _init_theme().
$base_urlThe base URL of the drupal installation.
$channelAn associative array containing title, link, description and other keys. The link should be an absolute URL.
$confArray of persistent variables stored in 'variable' table.
$cookie_domainThe domain to be used form session cookies.
$custom_themeName of custom theme to override default theme.
$db_prefixThe prefix to be placed on all database tables.
$db_typeThe type of database being used.
$db_urlThe url of the database. Thorough documentation provided in default.settings.php.
$elementStructured array describing the data to be rendered.
$forum_topic_list_headerAn array of topic header information.
$idActive statistics record id.
$imageCurrent image tag used by aggregator.
$installed_profileThe name of the profile that has just been installed.
$install_localeThe locale to use during installation
$itemGeneral string or array.
$itemsArray of items used by aggregator.
$languageAn object containing the information for the active language.
$last_resultResource of the query executed.
$menu_adminBoolean indicating that a menu administrator is running the menu access check.
$multibyteThe current multibyte mode. Possible values: UNICODE_ERROR, UNICODE_SINGLEBYTE, UNICODE_MULTIBYTE.
$nidActive blog node id.
$pager_page_arrayResult of pager_query() that is utilized by other functions.
$pager_totalArray of the total number of pages per pager. The key is will be 0 by defualt, but can be specified via the $element parameter of pager_query().
$pager_total_itemsArray of the total number of items per pager. The key is will be 0 by defualt, but can be specified via the $element parameter of pager_query().
$profileThe name of the currently installed profile.
$queriesArray of queries that have been executed.
$recent_activityRecent activity statistics generated by statistics_exit().
$tagActive tag name.
$themeName of the active theme.
$theme_engineThe active theme engine related to the active theme.
$theme_infoActive theme object. For documentation of the theme object see _init_theme().
$theme_keyName of the active theme.
$theme_pathPath to the active theme.
$timersStores timers that have been created by timer_start().
$update_free_accessAccess control for update.php script. Allows the update.php script to be run when not logged in as and administrator.
$update_modeDisabled caling hook_boot() and hook_exit() during the update process (update.php) since the database is in a largely unknown state.
$userRepresentation of the current user. Stores preferences and other user information.
$xrds_current_serviceArray used by XRDS XML parser for OpenID to track parsing state.
$xrds_open_elementsArray used by XRDS XML parser for OpenID to track parsing state.
$xrds_servicesArray used by XRDS XML parser for OpenID to track parsing state.

File

documentation/developer/globals.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * These are the global variables that Drupal uses.
  5. */
  6. /**
  7. * Stores timers that have been created by timer_start().
  8. *
  9. * @see timer_start()
  10. * @see timer_read()
  11. * @see timer_stop()
  12. */
  13. global $timers;
  14. /**
  15. * The base URL of the drupal installation.
  16. *
  17. * @see conf_init()
  18. */
  19. global $base_url;
  20. /**
  21. * The base path of the drupal installation. At least will default to /.
  22. *
  23. * @see conf_init()
  24. */
  25. global $base_path;
  26. /**
  27. * The root URL of the host excludes the path.
  28. *
  29. * @see conf_init()
  30. */
  31. global $base_root;
  32. /**
  33. * The url of the database. Thorough documentation provided in default.settings.php.
  34. */
  35. global $db_url;
  36. /**
  37. * The prefix to be placed on all database tables.
  38. */
  39. global $db_prefix;
  40. /**
  41. * The domain to be used form session cookies.
  42. *
  43. * Cookie domains must contain at least one dot other than the first (RFC 2109).
  44. * For hosts such as 'localhost' or an IP Addresses the cookie domain will not be set.
  45. */
  46. global $cookie_domain;
  47. /**
  48. * Array of persistent variables stored in 'variable' table.
  49. *
  50. * @see variable_get()
  51. * @see variable_set()
  52. * @see variable_del()
  53. */
  54. global $conf;
  55. /**
  56. * The name of the profile that has just been installed.
  57. */
  58. global $installed_profile;
  59. /**
  60. * Access control for update.php script. Allows the update.php script to be run when
  61. * not logged in as and administrator.
  62. */
  63. global $update_free_access;
  64. /**
  65. * Representation of the current user. Stores preferences and other user information.
  66. */
  67. global $user;
  68. /**
  69. * An object containing the information for the active language.
  70. *
  71. * Example values:
  72. * - 'language' => 'en',
  73. * - 'name' => 'English',
  74. * - 'native' => 'English',
  75. * - 'direction' => 0,
  76. * - 'enabled' => 1,
  77. * - 'plurals' => 0,
  78. * - 'formula' => '',
  79. * - 'domain' => '',
  80. * - 'prefix' => '',
  81. * - 'weight' => 0,
  82. * - 'javascript' => ''
  83. */
  84. global $language;
  85. /**
  86. * Disabled caling hook_boot() and hook_exit() during the update process (update.php) since
  87. * the database is in a largely unknown state.
  88. *
  89. * @see drupal_goto()
  90. */
  91. global $update_mode;
  92. /**
  93. * The name of the currently installed profile.
  94. */
  95. global $profile;
  96. /**
  97. * The type of database being used.
  98. *
  99. * Example: mysql.
  100. */
  101. global $db_type;
  102. /**
  103. * Active database connection.
  104. *
  105. * @see db_set_active()
  106. */
  107. global $active_db;
  108. /**
  109. * Array of queries that have been executed.
  110. */
  111. global $queries;
  112. /**
  113. * Resource of the query executed.
  114. */
  115. global $last_result;
  116. /**
  117. * The locale to use during installation
  118. *
  119. * @see st()
  120. */
  121. global $install_locale;
  122. /**
  123. * Result of pager_query() that is utilized by other functions.
  124. */
  125. global $pager_page_array;
  126. /**
  127. * Array of the total number of pages per pager. The key is will be 0 by defualt, but
  128. * can be specified via the $element parameter of pager_query().
  129. */
  130. global $pager_total;
  131. /**
  132. * Array of the total number of items per pager. The key is will be 0 by defualt, but
  133. * can be specified via the $element parameter of pager_query().
  134. */
  135. global $pager_total_items;
  136. /**
  137. * Name of the active theme.
  138. */
  139. global $theme;
  140. /**
  141. * Name of custom theme to override default theme.
  142. *
  143. * @see init_theme()
  144. */
  145. global $custom_theme;
  146. /**
  147. * Name of the active theme.
  148. *
  149. * @see init_theme()
  150. */
  151. global $theme_key;
  152. /**
  153. * Active theme object. For documentation of the theme object see _init_theme().
  154. *
  155. * @see _init_theme()
  156. */
  157. global $theme_info;
  158. /**
  159. * An array of objects that reperesent the base theme. For documentation of the
  160. * theme object see _init_theme().
  161. *
  162. * @see _init_theme()
  163. */
  164. global $base_theme_info;
  165. /**
  166. * The active theme engine related to the active theme.
  167. */
  168. global $theme_engine;
  169. /**
  170. * Path to the active theme.
  171. */
  172. global $theme_path;
  173. /**
  174. * The current multibyte mode.
  175. * Possible values: UNICODE_ERROR, UNICODE_SINGLEBYTE, UNICODE_MULTIBYTE.
  176. */
  177. global $multibyte;
  178. /**
  179. * General string or array.
  180. *
  181. * @see aggregator_element_start()
  182. */
  183. global $item;
  184. /**
  185. * Structured array describing the data to be rendered.
  186. *
  187. * @see aggregator_element_start()
  188. */
  189. global $element;
  190. /**
  191. * Active tag name.
  192. *
  193. * @see aggregator_element_start()
  194. */
  195. global $tag;
  196. /**
  197. * Array of items used by aggregator.
  198. *
  199. * @see aggregator_element_start()
  200. */
  201. global $items;
  202. /**
  203. * An associative array containing title, link, description and other keys.
  204. * The link should be an absolute URL.
  205. *
  206. * @see aggregator_element_start()
  207. */
  208. global $channel;
  209. /**
  210. * Current image tag used by aggregator.
  211. */
  212. global $image;
  213. /**
  214. * Active blog node id.
  215. */
  216. global $nid;
  217. /**
  218. * An array of topic header information.
  219. */
  220. global $forum_topic_list_header;
  221. /**
  222. * Boolean indicating that a menu administrator is running the menu access check.
  223. */
  224. global $menu_admin;
  225. /**
  226. * Array used by XRDS XML parser for OpenID to track parsing state.
  227. */
  228. global $xrds_services;
  229. /**
  230. * Array used by XRDS XML parser for OpenID to track parsing state.
  231. */
  232. global $xrds_open_elements;
  233. /**
  234. * Array used by XRDS XML parser for OpenID to track parsing state.
  235. */
  236. global $xrds_current_service;
  237. /**
  238. * Recent activity statistics generated by statistics_exit().
  239. */
  240. global $recent_activity;
  241. /**
  242. * Active statistics record id.
  243. */
  244. global $id;