-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlion
76 lines (60 loc) · 2.46 KB
/
lion
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
declare(strict_types=1);
define('LION_START', microtime(true));
const IS_INDEX = false;
/**
* -----------------------------------------------------------------------------
* Register The Auto Loader
* -----------------------------------------------------------------------------
* Composer provides a convenient, automatically generated class loader for
* this application
* -----------------------------------------------------------------------------
*/
require_once(__DIR__ . '/vendor/autoload.php');
use Dotenv\Dotenv;
use Lion\Bundle\Commands\CommandHandler;
use Lion\Files\Store;
/**
* -----------------------------------------------------------------------------
* Register environment variable loader automatically
* -----------------------------------------------------------------------------
* .dotenv provides an easy way to access environment variables with $_ENV
* -----------------------------------------------------------------------------
*/
if (isSuccess((new Store())->exist(__DIR__ . '/.env'))) {
Dotenv::createMutable(__DIR__)->load();
}
/**
* -----------------------------------------------------------------------------
* Database initialization
* -----------------------------------------------------------------------------
* */
include_once(__DIR__ . '/config/database.php');
/**
* -----------------------------------------------------------------------------
* Email initialization
* -----------------------------------------------------------------------------
* */
include_once(__DIR__ . '/config/email.php');
/**
* -----------------------------------------------------------------------------
* Local zone configuration
* -----------------------------------------------------------------------------
*/
date_default_timezone_set($_ENV['SERVER_DATE_TIMEZONE']);
/**
* -----------------------------------------------------------------------------
* Run The lion Application
* -----------------------------------------------------------------------------
* This is where the commands for your application are executed
* -----------------------------------------------------------------------------
*/
(new CommandHandler('Lion-Framework'))
->registerCommands(
'./vendor/lion/bundle/src/LionBundle/Commands/Lion/',
'Lion\\Bundle\\Commands\\Lion\\',
'Commands/Lion/'
)
->registerCommands('./app/Console/Commands/', 'App\\Console\\Commands\\', 'Console/Commands/')
->getApplication()
->run();