-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
asatru
62 lines (44 loc) · 1.79 KB
/
asatru
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
58
59
60
61
62
<?php
/*
Asatru PHP (dnyAsatruPHP) developed by Daniel Brendel
(C) 2019 - 2024 by Daniel Brendel
Contact: dbrendel1988<at>gmail<dot>com
GitHub: https://github.com/danielbrendel/
Released under the MIT license
*/
//Set application root directory path
define('ASATRU_APP_ROOT', __DIR__);
//If composer is installed then utilize its autoloader
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
//Require constants
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/constants.php';
//Require .env config management
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/dotenv.php';
//Parse .env file if it exists
if (file_exists('.env')) {
env_parse('.env');
}
//Require logging
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/logger.php';
//Require autoload component
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/autoload.php';
//Require config component
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/config.php';
//Require helpers
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/helper.php';
//Include CLI handler
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/console.php';
//Require database handler
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/database.php';
//Require command handler
require_once __DIR__ . '/vendor/danielbrendel/asatru-php-framework/src/commands.php';
//Process further if in debug mode
if ((isset($_ENV['APP_DEBUG'])) && ($_ENV['APP_DEBUG'])) {
Asatru\Console\handleInput($argv);
} else {
echo "\033[31mCLI tool is only available in debug mode\033[39m\n";
}
//Success, we can end script execution
exit(0);