@@ -123,6 +123,13 @@ public function register(ContainerInterface $container)
123123
124124 // Load asset schema
125125 if ($ config ['assets.use_raw ' ]) {
126+
127+ // Register sprinkle assets stream, plus vendor assets in shared streams
128+ $ locator ->registerStream ('assets ' , 'vendor ' , \UserFrosting \BOWER_ASSET_DIR , true );
129+ $ locator ->registerStream ('assets ' , 'vendor ' , \UserFrosting \NPM_ASSET_DIR , true );
130+ $ locator ->registerStream ('assets ' , 'vendor ' , \UserFrosting \BROWSERIFIED_ASSET_DIR , true );
131+ $ locator ->registerStream ('assets ' , '' , \UserFrosting \DS . \UserFrosting \ASSET_DIR_NAME );
132+
126133 $ baseUrl = $ config ['site.uri.public ' ] . '/ ' . $ config ['assets.raw.path ' ];
127134
128135 $ assets = new Assets ($ locator , 'assets ' , $ baseUrl );
@@ -144,6 +151,12 @@ public function register(ContainerInterface $container)
144151 $ assets ->addAssetBundles ($ bundles );
145152 }
146153 } else {
154+
155+ // Register compiled assets stream in public folder + alias for vendor ones + build stream for CompiledAssetBundles
156+ $ c ->locator ->registerStream ('assets ' , '' , \UserFrosting \PUBLIC_DIR_NAME . '/ ' . \UserFrosting \ASSET_DIR_NAME , true );
157+ $ c ->locator ->registerStream ('assets ' , 'vendor ' , \UserFrosting \PUBLIC_DIR_NAME . '/ ' . \UserFrosting \ASSET_DIR_NAME , true );
158+ $ c ->locator ->registerStream ('build ' , '' , \UserFrosting \BUILD_DIR_NAME , true );
159+
147160 $ baseUrl = $ config ['site.uri.public ' ] . '/ ' . $ config ['assets.compiled.path ' ];
148161 $ assets = new Assets ($ locator , 'assets ' , $ baseUrl );
149162
@@ -249,13 +262,6 @@ public function register(ContainerInterface $container)
249262
250263 $ config ->set ('csrf.blacklist ' , $ csrfBlacklist );
251264
252- // Reset 'assets' scheme in locator to use raw assets if specified in config.
253- // Must be done here to prevent circular dependency as config is not loaded in system and locator can't be extended here.
254- if (!$ config ['assets.use_raw ' ]) {
255- $ c ->locator ->removeStream ('assets ' );
256- $ c ->locator ->registerStream ('assets ' , '' , \UserFrosting \PUBLIC_DIR_NAME . '/ ' . \UserFrosting \ASSET_DIR_NAME , true );
257- }
258-
259265 return $ config ;
260266 };
261267
@@ -587,7 +593,8 @@ public function register(ContainerInterface $container)
587593 $ container ['router ' ] = function ($ c ) {
588594 $ routerCacheFile = false ;
589595 if (isset ($ c ->config ['settings.routerCacheFile ' ])) {
590- $ routerCacheFile = $ c ->config ['settings.routerCacheFile ' ];
596+ $ filename = $ c ->config ['settings.routerCacheFile ' ];
597+ $ routerCacheFile = $ c ->locator ->findResource ("cache:// $ filename " , true , true );
591598 }
592599
593600 return (new Router ())->setCacheFile ($ routerCacheFile );
0 commit comments