classes/Utilities/EnvironmentOptions.php
public static function Option($optionName = null, $envVariableName = null, $default = false) {
		if (empty($optionName) && empty($envVariableName)) {
			return $default;
		}

		if ($envVariableName == null) {
			$envVariableName = str_replace('-','_', strtoupper($optionName));
		}

		if (is_array($envVariableName)) {
			foreach($envVariableName as $envVariable) {
				$envval = getenv($envVariable);
				if ($envval) {
					return $envval;
				}
			}
		} else {
			$envval = getenv($envVariableName);
			if ($envval) {
				return $envval;
			}
		}

		if (empty($optionName)) {
			return $default;
		}

		return get_option($optionName, $default);
	}
public static function Option($optionName = null, $envVariableName = null, $default = false) {
		if (empty($optionName) && empty($envVariableName)) {
			return $default;
		}

		if ($envVariableName == null) {
			$envVariableName = str_replace('-','_', strtoupper($optionName));
		}

		if (is_array($envVariableName)) {
			foreach($envVariableName as $envVariable) {
				$envval = getenv($envVariable);
				if ($envval) {
					return $envval;
				}
			}
		} else {
			$envval = getenv($envVariableName);
			if ($envval) {
				return $envval;
			}
		}

		if (empty($optionName)) {
			return $default;
		}

		return get_option($optionName, $default);
	}
public static function Option ( $ optionName = null , $ envVariableName = null , $ default = false ) { if ( empty ( $ optionName ) && empty ( $ envVariableName ) ) { return $ default ; } if ( $ envVariableName == null ) { $ envVariableName = str_replace ( '-' , '_' , strtoupper ( $ optionName ) ) ; } if ( is_array ( $ envVariableName ) ) { foreach ( $ envVariableName as $ envVariable ) { $ envval = getenv ( $ envVariable ) ; if ( $ envval ) { return $ envval ; } } } else { $ envval = getenv ( $ envVariableName ) ; if ( $ envval ) { return $ envval ; } } if ( empty ( $ optionName ) ) { return $ default ; } return get_option ( $ optionName , $ default ) ; }
Fetches an option from WordPress or the environment.

@param string|null $optionName
@param string|array|null $envVariableName
@param bool $default

@return array|false|mixed|string|null
Fetches an option from WordPress or the environment .