3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Class CRM_Utils_Constant
21 class CRM_Utils_Constant
{
24 * Determine the value of a constant, if any.
26 * If the specified constant is undefined, check for an environment
27 * variable, defaulting the passed in default value.
30 * @param mixed $default
34 public static function value(string $name, $default = NULL) {
36 return constant($name);
38 if (($value = getenv($name)) !== FALSE) {
39 define($name, $value);