File tree Expand file tree Collapse file tree 9 files changed +22
-90
lines changed Expand file tree Collapse file tree 9 files changed +22
-90
lines changed Original file line number Diff line number Diff line change 77 - ' *.x'
88 - ' *.*.x'
99 pull_request :
10- schedule :
11- - cron : ' 0 0 * * 0'
1210
1311jobs :
1412 php-tests :
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ if ( file_exists( __DIR__ . '/../vendor/autoload.php' ) ) {
3030|
3131*/
3232
33- $ app = require_once MANTLE_BASE_DIR . '/bootstrap/app.php ' ;
33+ $ bootloader = require_once MANTLE_BASE_DIR . '/bootstrap/app.php ' ;
3434
3535/*
3636|--------------------------------------------------------------------------
@@ -42,6 +42,4 @@ $app = require_once MANTLE_BASE_DIR . '/bootstrap/app.php';
4242|
4343*/
4444
45- bootloader ( $ app )
46- ->set_base_path ( MANTLE_BASE_DIR )
47- ->boot ();
45+ $ bootloader ->boot ();
Original file line number Diff line number Diff line change 55 * @package Mantle
66 */
77
8- use Mantle \Contracts ;
9- use Mantle \Application \Application ;
8+ use Mantle \Framework \Bootloader ;
109
11- /**
12- * Instantiate the application
13- */
14- $ app = new Application ();
15-
16- /**
17- * Register the main contracts that power the application.
18- */
19- $ app ->singleton (
20- Contracts \Console \Kernel::class,
21- App \Console \Kernel::class,
22- );
23-
24- $ app ->singleton (
25- Contracts \Http \Kernel::class,
26- App \Http \Kernel::class,
27- );
28-
29- $ app ->singleton (
30- Contracts \Exceptions \Handler::class,
31- App \Exceptions \Handler::class
32- );
33-
34- return $ app ;
10+ return Bootloader::create ()
11+ ->with_kernels (
12+ console: App \Console \Kernel::class,
13+ http: App \Http \Kernel::class,
14+ )
15+ ->with_exception_handler ( App \Exceptions \Handler::class )
16+ ->with_routing (
17+ web: __DIR__ . '/../routes/web.php ' ,
18+ rest_api: __DIR__ . '/../routes/rest-api.php ' ,
19+ pass_through: true ,
20+ );
Original file line number Diff line number Diff line change 1111 ],
1212 "require" : {
1313 "alleyinteractive/composer-wordpress-autoloader" : " ^1.0" ,
14- "alleyinteractive/mantle-framework" : " ^1.0 " ,
14+ "alleyinteractive/mantle-framework" : " ^1.1 " ,
1515 "fakerphp/faker" : " ^1.23"
1616 },
1717 "require-dev" : {
Original file line number Diff line number Diff line change 2525 |--------------------------------------------------------------------------
2626 |
2727 | Providers listed here will be autoloaded for every request on the application.
28+ | The providers listed here will be merged with the default framework providers.
2829 |
2930 */
3031 'providers ' => [
31- // Framework Providers.
32- Mantle \Filesystem \Filesystem_Service_Provider::class,
33- Mantle \Database \Factory_Service_Provider::class,
34- Mantle \Framework \Providers \Error_Service_Provider::class,
35- Mantle \Database \Model_Service_Provider::class,
36- Mantle \Queue \Queue_Service_Provider::class,
37- Mantle \Query_Monitor \Query_Monitor_Service_Provider::class,
38- Mantle \New_Relic \New_Relic_Service_Provider::class,
39- Mantle \Database \Pagination \Paginator_Service_Provider::class,
40- Mantle \Cache \Cache_Service_Provider::class,
41-
42- // Application Providers.
4332 App \Providers \App_Service_Provider::class,
4433 App \Providers \Asset_Service_Provider::class,
4534 App \Providers \Event_Service_Provider::class,
46- App \Providers \Route_Service_Provider::class,
4735 ],
4836
4937 /*
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function () {
8080|
8181*/
8282
83- $ app = require_once __DIR__ . '/bootstrap/app.php ' ;
83+ $ bootloader = require_once __DIR__ . '/bootstrap/app.php ' ;
8484
8585/*
8686|--------------------------------------------------------------------------
@@ -92,4 +92,4 @@ function () {
9292|
9393*/
9494
95- bootloader ( $ app ) ->boot ();
95+ $ bootloader ->boot ();
Original file line number Diff line number Diff line change 3333 <properties >
3434 <property name =" prefixes" type =" array" >
3535 <element value =" App" />
36+ <element value =" bootloader" />
3637 </property >
3738 </properties >
3839 <exclude-pattern >views/</exclude-pattern >
Original file line number Diff line number Diff line change @@ -20,16 +20,10 @@ trait CreateApplication {
2020 * @return \Mantle\Application\Application
2121 */
2222 public function create_application (): \Mantle \Contracts \Application {
23- // Allow non-mantle-site usage.
24- if ( ! file_exists ( __DIR__ . '/../bootstrap/app.php ' ) ) {
25- echo "Application bootstrap not found: creating new instance... " ;
26- return new Application ( __DIR__ . '/../ ' , home_url ( '/ ' ) );
27- }
23+ $ bootloader = require __DIR__ . '/../bootstrap/app.php ' ;
2824
29- $ app = require __DIR__ . ' /../ bootstrap/app.php ' ;
25+ $ bootloader -> make ( Kernel::class )-> bootstrap () ;
3026
31- $ app ->make ( Kernel::class )->bootstrap ();
32-
33- return $ app ;
27+ return $ bootloader ->get_application ();
3428 }
3529}
You can’t perform that action at this time.
0 commit comments