-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpreload.php
More file actions
33 lines (28 loc) · 761 Bytes
/
preload.php
File metadata and controls
33 lines (28 loc) · 761 Bytes
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
<?php
declare(strict_types=1);
/**
* Application constants
*/
require_once __DIR__ . '/const.php';
if (file_exists(APP['path']['ext'] . '/const.php')) {
require_once APP['path']['ext'] . '/const.php';
}
/**
* Recursively require base and extension source files
*/
$scan = function (string $path) use (&$scan): void {
array_map(fn(string $file): int|bool => include_once $file, glob($path . '/*.php'));
array_map($scan, glob($path . '/*', GLOB_ONLYDIR));
};
array_map($scan, [APP['path']['app.src'], APP['path']['ext.src']]);
unset($scan);
/**
* Extension preload
*/
if (file_exists(APP['path']['ext'] . '/preload.php')) {
require_once APP['path']['ext'] . '/preload.php';
}
/**
* Back up pregenerated configuration
*/
cfg\backup();