аэы
This commit is contained in:
25
api/_config.php
Normal file
25
api/_config.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$Config = array();
|
||||
$Config_FileName = "config.json";
|
||||
$Config_PossiblePaths = array(
|
||||
"./" . $Config_FileName,
|
||||
"../" . $Config_FileName,
|
||||
"../../" . $Config_FileName,
|
||||
"../../../" . $Config_FileName,
|
||||
"./api/" . $Config_FileName,
|
||||
);
|
||||
|
||||
foreach ($Config_PossiblePaths as $path) {
|
||||
if (file_exists($path)) {
|
||||
$content = file_get_contents($path);
|
||||
$Config = json_decode($content, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$Config) {
|
||||
die("invalid configuration file");
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user