globals.php

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

These are the global variables that Drupal uses.

Globals

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