File tree Expand file tree Collapse file tree 2 files changed +15
-21
lines changed
Expand file tree Collapse file tree 2 files changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,7 @@ require __DIR__ . '/vendor/autoload.php';
3333| Quickly use our environment variables
3434|
3535*/
36- try {
37- \Dotenv \Dotenv::createUnsafeImmutable (__DIR__ )->load ();
38- } catch (\Throwable $ th ) {
39- trigger_error ($ th );
40- }
36+ \Leaf \Core::loadApplicationEnv (__DIR__ );
4137
4238/*
4339|--------------------------------------------------------------------------
Original file line number Diff line number Diff line change 11<?php
22
3+ $ appPath = dirname (__DIR__ );
4+
35/*
46|--------------------------------------------------------------------------
57| Switch to root path
911| resolve app paths.
1012|
1113*/
12- chdir (dirname ( __DIR__ ) );
14+ chdir ($ appPath );
1315
1416/*
1517|--------------------------------------------------------------------------
2224| loading of any our classes "manually". Feels great to relax.
2325|
2426*/
25- require dirname (__DIR__ ) . '/vendor/autoload.php ' ;
26-
27- /*
28- |--------------------------------------------------------------------------
29- | Bring in (env)
30- |--------------------------------------------------------------------------
31- |
32- | Quickly use our environment variables
33- |
34- */
35- try {
36- \Dotenv \Dotenv::createUnsafeImmutable (dirname (__DIR__ ))->load ();
37- } catch (\Throwable $ th ) {
38- trigger_error ($ th );
39- }
27+ require "$ appPath/vendor/autoload.php " ;
4028
4129/*
4230|--------------------------------------------------------------------------
5644 unset($ path );
5745}
5846
47+ /*
48+ |--------------------------------------------------------------------------
49+ | Bring in (env)
50+ |--------------------------------------------------------------------------
51+ |
52+ | Load our environment variables into our application context
53+ |
54+ */
55+ \Leaf \Core::loadApplicationEnv ($ appPath );
56+
5957/*
6058|--------------------------------------------------------------------------
6159| Run your Leaf MVC application
You can’t perform that action at this time.
0 commit comments