-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_keys.php
More file actions
executable file
·57 lines (47 loc) · 2.48 KB
/
api_keys.php
File metadata and controls
executable file
·57 lines (47 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/* ────────────────────────────────────────────────────────────────────────── */
/* api_keys.php */
/* ────────────────────────────────────────────────────────────────────────── */
/* ──────── Made with ❤️ by darknetzz @ https://github.com/darknetzz ──────── */
/* ────────────────────────────────────────────────────────────────────────── */
/*
# This file should contain the default values for everything in keys -
# and it should be applied if the constants are not defined, which could cause an error.
# NOTE: Please do not change this file directly, change the values in
# the 'keys' folder instead.
*/
if (defined('API_KEYS')) {
die("
API_KEYS is already defined. Please check your settings.
It should NOT be defined in any of the files under your 'settings' folder, only in api_keys.php.
");
}
do {
# Check if keys folder contains custom configuration files.
$keys_folder = dirname(__FILE__) . '/keys'; # Relative path to keys folder.
$keys_files = glob("$keys_folder/*.php"); # Get all files in the keys folder.
$count = count($keys_files); # Count the number of files in the keys folder.
if (empty($keys_files)) {
die("No keys files found in keys folder.");
}
$excludes = [
$keys_folder."/my_custom_keys.php",
];
$count_excludes = count($excludes);
if ($count == $count_excludes) {
require_once($keys_folder."/my_custom_keys.php");
} elseif ($count > $count_excludes) {
foreach (glob($keys_folder."/*.php") as $file) {
if (!in_array($file, $excludes)) {
require_once($file);
}
}
}
if (!isset($apikeys) || empty($apikeys)) {
die("Variable \$apikeys not set. Please check your settings (or more specifically your keys folder).");
}
define('API_KEYS', $apikeys);
break;
die("Something went wrong while loading keys files.");
} while (False);
?>