This project is not covered by Drupal’s security advisory policy.

Globals solves the problem of providing user editable configuration properties by giving developers an API for providing these properties.

Usage

Globals provides a hook for declaring global properties, as well as a functions for getting these values back for later use.

Current hook documentation is available in the globals.api.php file.

There are two primary functions for retrieving these values:

<?php
/**
 * Get a global value.
 *
 * A useful shorthand for accessing the Globals object.
 *
 * @param string $key
 *   Key to access
 *
 * @return mixed
 *   Result of the global
 */
function globals_get($key) {
  return Globals::init()->getGlobalValue($key);
}

/**
 * Get a global value filtered.
 *
 * @param string $key
 *   Global value key
 * @param string $check_function
 *   Filter name. Defaults to 'check_plain'. If you provide another filter
 *   value, its up to you to ensure the output is secure.
 *
 * @return mixed
 *   Result of the query.
 * @throws \Drupal\ghost\Exception\GhostException
 */
function globals_filter($key, $check_function = 'check_plain') {
  return Globals::init()->getFilteredValue($key, $check_function);
}
?>
Supporting organizations: 
Current project sponsors

Project information

Releases