-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_endpoints.php
More file actions
executable file
·48 lines (39 loc) · 2.2 KB
/
api_endpoints.php
File metadata and controls
executable file
·48 lines (39 loc) · 2.2 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
<?php
/* ────────────────────────────────────────────────────────────────────────── */
/* api_endpoints.php */
/* ────────────────────────────────────────────────────────────────────────── */
/* ──────── Made with ❤️ by darknetzz @ https://github.com/darknetzz ──────── */
/* ────────────────────────────────────────────────────────────────────────── */
/*
# This file should contain the default values for everything in endpoints -
# 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 'endpoints' folder instead.
*/
do {
# Check if endpoints folder contains custom configuration files.
$endpoints_folder = dirname(__FILE__) . '/endpoints'; # Relative path to endpoints folder.
$endpoints_files = glob("$endpoints_folder/*.php"); # Get all files in the endpoints folder.
$count = count($endpoints_files); # Count the number of files in the endpoints folder.
if (empty($endpoints_files)) {
die("No endpoints files found in endpoints folder.");
}
$excludes = [
$endpoints_folder."/my_custom_endpoints.php",
];
$count_excludes = count($excludes);
if ($count == $count_excludes) {
require_once($endpoints_folder."/my_custom_endpoints.php");
break;
}
if ($count > $count_excludes) {
foreach (glob($endpoints_folder."/*.php") as $file) {
if (!in_array($file, $excludes)) {
require_once($file);
}
}
break;
}
die("Something went wrong while loading endpoints files.");
} while (False);
?>