11use
function array_key_exists;
35 private readonly
string $prefix =
'wg',
42 public function get( $name ) {
43 $var = $this->prefix . $name;
46 $value = $GLOBALS[$var] ??
null;
47 if ( $value !==
null ) {
53 if ( array_key_exists( $var, $GLOBALS ) ) {
57 throw new ConfigException( __METHOD__ .
": undefined option: '$name'" );
63 public function has( $name ) {
64 $var = $this->prefix . $name;
69 return isset( $GLOBALS[$var] ) || array_key_exists( $var, $GLOBALS );
74class_alias( GlobalVarConfig::class,
'GlobalVarConfig' );