mirror of
https://github.com/glmdev/eecs448-lab10
synced 2026-03-02 03:39:24 +00:00
Initial commit
This commit is contained in:
18
common/functions_config.php
Normal file
18
common/functions_config.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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;
|
||||
}
|
||||
Reference in New Issue
Block a user