File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1515- Sprinkle list in the bakery ` debug ` command to uses the new ` sprinkle:list ` table
1616- ` routerCacheFile ` config now only contains filename. Locator is used to find the full path
1717- Moved some constants from ` app/defines.php ` to ` app/sprinkles/core/defines.php `
18+ - Move route initialization from system to core sprinkle as router service is located in the core sprinkle
1819
1920### Fix
2021- Fix for ` Test ` Bakery command
Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ public static function getSubscribedEvents()
4444 return [
4545 'onSprinklesInitialized ' => ['onSprinklesInitialized ' , 0 ],
4646 'onSprinklesRegisterServices ' => ['onSprinklesRegisterServices ' , 0 ],
47- 'onAddGlobalMiddleware ' => ['onAddGlobalMiddleware ' , 0 ]
47+ 'onAddGlobalMiddleware ' => ['onAddGlobalMiddleware ' , 0 ],
48+ 'onAppInitialize ' => ['onAppInitialize ' , 0 ]
4849 ];
4950 }
5051
@@ -103,6 +104,16 @@ public function onSprinklesRegisterServices()
103104 $ sh ->register ();
104105 }
105106
107+ /**
108+ * Register routes
109+ *
110+ * @param Event $event
111+ */
112+ public function onAppInitialize (Event $ event )
113+ {
114+ $ this ->ci ->router ->loadRoutes ($ event ->getApp ());
115+ }
116+
106117 /**
107118 * Add CSRF middleware.
108119 *
Original file line number Diff line number Diff line change @@ -149,9 +149,6 @@ protected function setupApp()
149149
150150 $ this ->fireEvent ('onAppInitialize ' , $ slimAppEvent );
151151
152- // Set up all routes
153- $ this ->ci ->router ->loadRoutes ($ this ->app );
154-
155152 // Add global middleware
156153 $ this ->fireEvent ('onAddGlobalMiddleware ' , $ slimAppEvent );
157154 }
You can’t perform that action at this time.
0 commit comments