Skip to content
This repository
Browse code

FIX issue with cyclic configs when framework called sapphire

The _config/route rules explicitly mentioned framework by module name,
so if you installed framework in the older sapphire directory youd
always end up with cyclic config requirement errors
  • Loading branch information...
commit 26cfd64d8e1dcf88dd43cb5f486d1ceca5158ed0 1 parent aa0cd14
Hamish Friedlander authored August 28, 2012
10  _config/routes.yml
@@ -9,8 +9,8 @@ Director:
9 9
 Name: coreroutes
10 10
 Before: '*'
11 11
 After:
12  
-  - framework/routes#rootroutes
13  
-  - cms/routes#modelascontrollerroutes
  12
+  - '#rootroutes'
  13
+  - '#modelascontrollerroutes'
14 14
 ---
15 15
 Director:
16 16
   rules:
@@ -25,9 +25,9 @@ Director:
25 25
 Name: adminroutes
26 26
 Before: '*'
27 27
 After:
28  
-  - framework/routes#rootroutes
29  
-  - framework/routes#coreroutes
30  
-  - cms/routes#modelascontrollerroutes
  28
+  - '#rootroutes'
  29
+  - '#coreroutes'
  30
+  - '#modelascontrollerroutes'
31 31
 ---
32 32
 Director:
33 33
   rules:
9  core/manifest/ConfigManifest.php
@@ -223,11 +223,12 @@ public function addYAMLConfigFile($basename, $pathname, $depth) {
223 223
 						// For each, parse out into module/file#name, and set any missing to "*"
224 224
 						$header[$order] = array();
225 225
 						foreach($orderparts as $part) {
226  
-							preg_match('! (\*|\w+) (?:\/(\*|\w+) (?:\*|\#(\w+))? )? !x', $part, $match);
  226
+							preg_match('! (?P<module>\*|\w+)? (\/ (?P<file>\*|\w+))? (\# (?P<fragment>\*|\w+))? !x', $part, $match);
  227
+
227 228
 							$header[$order][] = array(
228  
-								'module' => $match[1],
229  
-								'file' => isset($match[2]) ? $match[2] : '*',
230  
-								'name' => isset($match[3]) ? $match[3] : '*'
  229
+								'module' => isset($match['module']) && $match['module'] ? $match['module'] : '*',
  230
+								'file' => isset($match['file']) && $match['file'] ? $match['file'] : '*',
  231
+								'name' => isset($match['fragment'])  && $match['fragment'] ? $match['fragment'] : '*'
231 232
 							);
232 233
 						}
233 234
 					}

0 notes on commit 26cfd64

Please sign in to comment.
Something went wrong with that request. Please try again.