-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoboot.php
40 lines (33 loc) ยท 1.08 KB
/
autoboot.php
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
<?php
/*
* --------------------------------------------------------------------------
* Bootgly PHP Framework
* Developed by Rodrigo Vieira (@rodrigoslayertech)
* Copyright 2023-present
* Licensed under MIT
* --------------------------------------------------------------------------
*/
// ?
if (defined('CONSOLE_ROOT_BASE') === true) {
return;
}
// !
define('CONSOLE_ROOT_BASE', __DIR__);
define('CONSOLE_ROOT_DIR', __DIR__ . DIRECTORY_SEPARATOR);
if (defined('CONSOLE_WORKING_BASE') === false) {
define('CONSOLE_WORKING_BASE', CONSOLE_ROOT_BASE);
define('CONSOLE_WORKING_DIR', CONSOLE_ROOT_DIR);
}
define('CONSOLE_VERSION', '0.1.0-alpha');
// ! Bootables ([0-9]) || (-[a-z]) || ([0-9]-[a-z])
// -- nothing --
// ! Classes ([A-Z])
// App (Application Programming Interface)
spl_autoload_register (function (string $class) {
$paths = explode('\\', $class);
$file = implode('/', $paths) . '.php';
$included = @include(CONSOLE_WORKING_DIR . $file);
if ($included === false && CONSOLE_ROOT_DIR !== CONSOLE_WORKING_DIR) {
@include(CONSOLE_ROOT_DIR . $file);
}
});