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
$base_pathThe base path of the Drupal installation.
$base_rootThe root URL of the host, excluding the path.
$base_theme_infoAn array of objects that represent the base theme.
$base_urlThe base URL of the Drupal installation.
$channelAn associative array containing title, link, description and other keys.
$confArray of persistent variables stored in 'variable' table.
$cookie_domainThe domain to be used for session cookies.
$custom_themeName of custom theme to override default theme.
$databasesArray of database connections.
$elementStructured array describing the data to be rendered.
$forum_topic_list_headerAn array of forum topic header information.
$imageCurrent image tag used by aggregator parsing.
$installed_profileThe name of the profile that has just been installed.
$itemGeneral string or array.
$itemsArray of items used by aggregator.
$languageAn object containing the information for the active interface language.
$language_contentAn object containing the information for the active content language.
$language_urlAn object containing the information for the active URL language.
$menu_adminBoolean indicating that a menu administrator is running a menu access check.
$multibyteThe current multibyte mode.
$pager_limitsArray of the number of items per page for each pager.
$pager_page_arrayArray of current page numbers for each pager.
$pager_totalArray of the total number of pages for each pager.
$pager_total_itemsArray of the total number of items for each pager.
$tagActive tag name.
$themeName of the active theme.
$theme_engineThe theme engine related to the active theme.
$theme_infoActive theme object.
$theme_keyName of the active theme.
$theme_pathThe path to the active theme.
$timersTimers that have been created by timer_start().
$update_free_accessAllows the update.php script to be run when not logged in as administrator.
$userAn object representing the currently logged-in user.

File

documentation/developer/globals.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * These are the global variables that Drupal uses.
  5. */
  6. /**
  7. * 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 drupal_settings_initialize()
  18. */
  19. global $base_url;
  20. /**
  21. * The base path of the Drupal installation.
  22. *
  23. * This will at least default to '/'.
  24. *
  25. * @see drupal_settings_initialize()
  26. */
  27. global $base_path;
  28. /**
  29. * The root URL of the host, excluding the path.
  30. *
  31. * @see drupal_settings_initialize()
  32. */
  33. global $base_root;
  34. /**
  35. * Array of database connections.
  36. *
  37. * @see default.settings.php
  38. */
  39. global $databases;
  40. /**
  41. * The domain to be used for 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
  45. * be set.
  46. *
  47. * @see default.settings.php
  48. */
  49. global $cookie_domain;
  50. /**
  51. * Array of persistent variables stored in 'variable' table.
  52. *
  53. * @see variable_get()
  54. * @see variable_set()
  55. * @see variable_del()
  56. */
  57. global $conf;
  58. /**
  59. * The name of the profile that has just been installed.
  60. */
  61. global $installed_profile;
  62. /**
  63. * Allows the update.php script to be run when not logged in as administrator.
  64. *
  65. * @see default.settings.php
  66. */
  67. global $update_free_access;
  68. /**
  69. * An object representing the currently logged-in user.
  70. *
  71. * Contains preferences and other user information.
  72. */
  73. global $user;
  74. /**
  75. * An object containing the information for the active interface language.
  76. *
  77. * It represents the language the user interface textual elements such as
  78. * titles, labels or messages, are to be displayed in.
  79. *
  80. * Example values:
  81. * - 'language' => 'en',
  82. * - 'name' => 'English',
  83. * - 'native' => 'English',
  84. * - 'direction' => 0,
  85. * - 'enabled' => 1,
  86. * - 'plurals' => 0,
  87. * - 'formula' => '',
  88. * - 'domain' => '',
  89. * - 'prefix' => '',
  90. * - 'weight' => 0,
  91. * - 'javascript' => ''
  92. *
  93. * @see LANGUAGE_TYPE_INTERFACE
  94. * @see drupal_language_initialize()
  95. */
  96. global $language;
  97. /**
  98. * An object containing the information for the active content language.
  99. *
  100. * It is used by the Field API as a default value when no language is specified
  101. * to select the field translation to be displayed.
  102. *
  103. * @see LANGUAGE_TYPE_CONTENT
  104. * @see drupal_language_initialize()
  105. */
  106. global $language_content;
  107. /**
  108. * An object containing the information for the active URL language.
  109. *
  110. * It is used as a default value by URL-related functions such as l() when no
  111. * language is explicitly specified.
  112. *
  113. * @see LANGUAGE_TYPE_URL
  114. * @see drupal_language_initialize()
  115. */
  116. global $language_url;
  117. /**
  118. * Array of current page numbers for each pager.
  119. *
  120. * @see PagerDefault
  121. */
  122. global $pager_page_array;
  123. /**
  124. * Array of the total number of pages for each pager.
  125. *
  126. * The array index is the pager element index (0 by default).
  127. *
  128. * @see PagerDefault
  129. */
  130. global $pager_total;
  131. /**
  132. * Array of the total number of items for each pager.
  133. *
  134. * The array index is the pager element index (0 by default).
  135. *
  136. * @see PagerDefault
  137. */
  138. global $pager_total_items;
  139. /**
  140. * Array of the number of items per page for each pager.
  141. *
  142. * The array index is the pager element index (0 by default).
  143. *
  144. * @see PagerDefault
  145. */
  146. global $pager_limits;
  147. /**
  148. * Name of the active theme.
  149. */
  150. global $theme;
  151. /**
  152. * Name of custom theme to override default theme.
  153. *
  154. * @see init_theme()
  155. */
  156. global $custom_theme;
  157. /**
  158. * Name of the active theme.
  159. *
  160. * @see init_theme()
  161. */
  162. global $theme_key;
  163. /**
  164. * Active theme object.
  165. *
  166. * @see _drupal_theme_initialize()
  167. */
  168. global $theme_info;
  169. /**
  170. * An array of objects that represent the base theme.
  171. *
  172. * @see _drupal_theme_initialize()
  173. */
  174. global $base_theme_info;
  175. /**
  176. * The theme engine related to the active theme.
  177. */
  178. global $theme_engine;
  179. /**
  180. * The path to the active theme.
  181. */
  182. global $theme_path;
  183. /**
  184. * The current multibyte mode.
  185. *
  186. * Possible values: UNICODE_ERROR, UNICODE_SINGLEBYTE, UNICODE_MULTIBYTE.
  187. */
  188. global $multibyte;
  189. /**
  190. * General string or array.
  191. *
  192. * @see aggregator_element_start()
  193. */
  194. global $item;
  195. /**
  196. * Structured array describing the data to be rendered.
  197. *
  198. * @see aggregator_element_start()
  199. */
  200. global $element;
  201. /**
  202. * Active tag name.
  203. *
  204. * @see aggregator_element_start()
  205. */
  206. global $tag;
  207. /**
  208. * Array of items used by aggregator.
  209. *
  210. * @see aggregator_element_start()
  211. */
  212. global $items;
  213. /**
  214. * An associative array containing title, link, description and other keys.
  215. *
  216. * The link should be an absolute URL.
  217. *
  218. * @see aggregator_element_start()
  219. */
  220. global $channel;
  221. /**
  222. * Current image tag used by aggregator parsing.
  223. *
  224. * @see aggregator_aggregator_parse()
  225. */
  226. global $image;
  227. /**
  228. * An array of forum topic header information.
  229. */
  230. global $forum_topic_list_header;
  231. /**
  232. * Boolean indicating that a menu administrator is running a menu access check.
  233. */
  234. global $menu_admin;