mirror of
https://github.com/glmdev/eecs448-lab10
synced 2024-10-27 19:14:00 +00:00
19 lines
368 B
PHP
19 lines
368 B
PHP
<?php
|
|
|
|
function config($path, $default_value = null) {
|
|
$parts = explode('.', $path);
|
|
|
|
if ( !$parts[0] ) {
|
|
return $default_value;
|
|
}
|
|
|
|
$config = require_system('config/' . $parts[0] . '.php');
|
|
foreach ( $parts as $i => $part ) {
|
|
if ( $i !== 0 && $config ) {
|
|
$config = $config[$part];
|
|
}
|
|
}
|
|
|
|
return $config;
|
|
}
|