Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit a045e5d

Browse files
committed
👽 updated aloe cli
1 parent 39b94e7 commit a045e5d

1 file changed

Lines changed: 21 additions & 15 deletions

File tree

leaf

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,53 @@
1111
| loading of any our classes "manually". Feels great to relax.
1212
|
1313
*/
14-
require __DIR__.'/vendor/autoload.php';
14+
require __DIR__ . '/vendor/autoload.php';
1515

1616
/*
1717
|--------------------------------------------------------------------------
18-
| Register The Leaf Command Auto Loader
18+
| Load MVC Core
1919
|--------------------------------------------------------------------------
2020
|
21-
| Require all the files containing the Leaf Commands
21+
| MVC core provides Leaf's auto loading, configuration and shortcut
22+
| functions right off the bat.
2223
|
2324
*/
24-
require __DIR__.'/Config/bootstrap.php';
25+
Leaf\Core::paths(PathsConfig());
2526

2627
/*
2728
|--------------------------------------------------------------------------
28-
| Initialise App paths
29+
| Bring in (env)
2930
|--------------------------------------------------------------------------
3031
|
31-
| These is the Leaf MVC directory configuration.
32+
| Quickly use our environment variables
3233
|
3334
*/
34-
require __DIR__ . "/Config/paths.php";
35+
try {
36+
\Dotenv\Dotenv::create(__DIR__)->load();
37+
} catch (\Throwable $th) {
38+
trigger_error($th);
39+
}
3540

3641
/*
3742
|--------------------------------------------------------------------------
38-
| Bring in (env)
43+
| Additional Leaf Database Config
3944
|--------------------------------------------------------------------------
4045
|
41-
| Quickly use our environment variables
46+
| Load leaf database configuration
4247
|
4348
*/
44-
\Dotenv\Dotenv::create(__DIR__)->load();
49+
Leaf\Database::config(DatabaseConfig());
50+
Leaf\Database::connect();
4551

4652
/*
4753
|--------------------------------------------------------------------------
48-
| Initialise Aloe
54+
| Initialise Leaf CMD
4955
|--------------------------------------------------------------------------
5056
|
51-
| Initialise aloe cli and register default commands.
57+
| Initialise aloe CLI
5258
|
5359
*/
54-
$console = new \Aloe\Console("Leaf API", "v2.0");
60+
$console = new \Aloe\Console("Leaf API", "v2.1");
5561

5662
/*
5763
|--------------------------------------------------------------------------
@@ -65,10 +71,10 @@ $console = new \Aloe\Console("Leaf API", "v2.0");
6571

6672
/*
6773
|--------------------------------------------------------------------------
68-
| Add custom command
74+
| Add commands
6975
|--------------------------------------------------------------------------
7076
|
71-
| If you have a new command to add to Leaf
77+
| Add custom commands
7278
|
7379
*/
7480
$console->register(\App\Console\ExampleCommand::class);

0 commit comments

Comments
 (0)