1
0
mirror of https://github.com/glmdev/eecs448-lab10 synced 2024-10-27 19:14:00 +00:00
eecs448-lab10/common/functions_config.php

19 lines
368 B
PHP
Raw Permalink Normal View History

2020-12-06 19:58:02 +00:00
<?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;
}