@@ -8,24 +8,24 @@ discard block  | 
                                                    ||
| 8 | 8 | class WaterfallRouter extends Router  | 
                                                        
| 9 | 9 |  { | 
                                                        
| 10 | 10 | |
| 11 | - protected function get_redirect_array()  | 
                                                        |
| 12 | -	{ | 
                                                        |
| 13 | - return array(  | 
                                                        |
| 14 | - (object) array(  | 
                                                        |
| 15 | - 'pattern' => '@/index.(html|htm|php)$@',  | 
                                                        |
| 16 | - 'replace' => '/'),  | 
                                                        |
| 17 | - (object) array(  | 
                                                        |
| 18 | - 'pattern' => '@^/home(/?)$@',  | 
                                                        |
| 19 | - 'replace' => '/'),  | 
                                                        |
| 20 | - (object) array(  | 
                                                        |
| 21 | - 'pattern' => '@^/falls/by-rating(/?)$@',  | 
                                                        |
| 22 | - 'replace' => '/falls/'),  | 
                                                        |
| 23 | - (object) array(  | 
                                                        |
| 24 | - 'pattern' => '@^/falls/by-rating/([0-9]+)(/?)$@',  | 
                                                        |
| 25 | - 'replace' => '/falls/'),  | 
                                                        |
| 26 | - (object) array(  | 
                                                        |
| 27 | - 'pattern' => '@^/falls/results(/?)$@',  | 
                                                        |
| 28 | - 'replace' => '/falls/'),  | 
                                                        |
| 11 | + protected function get_redirect_array()  | 
                                                        |
| 12 | +    { | 
                                                        |
| 13 | + return array(  | 
                                                        |
| 14 | + (object) array(  | 
                                                        |
| 15 | + 'pattern' => '@/index.(html|htm|php)$@',  | 
                                                        |
| 16 | + 'replace' => '/'),  | 
                                                        |
| 17 | + (object) array(  | 
                                                        |
| 18 | + 'pattern' => '@^/home(/?)$@',  | 
                                                        |
| 19 | + 'replace' => '/'),  | 
                                                        |
| 20 | + (object) array(  | 
                                                        |
| 21 | + 'pattern' => '@^/falls/by-rating(/?)$@',  | 
                                                        |
| 22 | + 'replace' => '/falls/'),  | 
                                                        |
| 23 | + (object) array(  | 
                                                        |
| 24 | + 'pattern' => '@^/falls/by-rating/([0-9]+)(/?)$@',  | 
                                                        |
| 25 | + 'replace' => '/falls/'),  | 
                                                        |
| 26 | + (object) array(  | 
                                                        |
| 27 | + 'pattern' => '@^/falls/results(/?)$@',  | 
                                                        |
| 28 | + 'replace' => '/falls/'),  | 
                                                        |
| 29 | 29 | (object) array(  | 
                                                        
| 30 | 30 | 'pattern' => '@^/log(/?)$@',  | 
                                                        
| 31 | 31 | 'replace' => '/journal/'),  | 
                                                        
@@ -35,47 +35,47 @@ discard block  | 
                                                    ||
| 35 | 35 | (object) array(  | 
                                                        
| 36 | 36 | 'pattern' => '@^/map/([^/]+)(/?)$@',  | 
                                                        
| 37 | 37 | 'replace' => '/map/'),  | 
                                                        
| 38 | - (object) array(  | 
                                                        |
| 39 | - 'pattern' => '@^/about/([a-z]*)(/?)$@',  | 
                                                        |
| 40 | - 'replace' => '/about/'),  | 
                                                        |
| 41 | - (object) array(  | 
                                                        |
| 42 | - 'pattern' => '@^/birch-creek/birch-creek-falls/?$@',  | 
                                                        |
| 43 | - 'replace' => '/birch-creek/gold-mine-falls/'),  | 
                                                        |
| 44 | - (object) array(  | 
                                                        |
| 45 | - 'pattern' => '@^/big-iron-river/bonanza-falls/?$@',  | 
                                                        |
| 46 | - 'replace' => '/big-iron-river/greenwood-falls/'),  | 
                                                        |
| 47 | - (object) array(  | 
                                                        |
| 48 | - 'pattern' => '@^/east-branch-huron-river/east-branch-huron-river-falls/?$@',  | 
                                                        |
| 49 | - 'replace' => '/east-branch-huron-river/east-branch-falls/'),  | 
                                                        |
| 50 | - (object) array(  | 
                                                        |
| 51 | - 'pattern' => '@^/montreal-river/lower-montreal-falls/?$@',  | 
                                                        |
| 52 | - 'replace' => '/montreal-river/montreal-falls/'),  | 
                                                        |
| 53 | - (object) array(  | 
                                                        |
| 54 | - 'pattern' => '@^/manganese-creek/manganese-gorge-falls/?$@',  | 
                                                        |
| 55 | - 'replace' => '/manganese-creek/manganese-falls/'),  | 
                                                        |
| 56 | - (object) array(  | 
                                                        |
| 57 | - 'pattern' => '@^/dead-river/tourist-park-dam-falls/?$@',  | 
                                                        |
| 58 | - 'replace' => '/dead-river/tourist-park-falls/'),  | 
                                                        |
| 59 | - (object) array(  | 
                                                        |
| 60 | - 'pattern' => '@^/sturgeon-river/upper-sturgeon-falls/?$@',  | 
                                                        |
| 61 | - 'replace' => '/sturgeon-river/little-spruce-falls/'),  | 
                                                        |
| 62 | - (object) array(  | 
                                                        |
| 63 | - 'pattern' => '@^/tahquamenon-river/upper-tahquamenon-falls/?$@',  | 
                                                        |
| 64 | - 'replace' => '/tahquamenon-river/tahquamenon-falls/'),  | 
                                                        |
| 65 | - (object) array(  | 
                                                        |
| 66 | - 'pattern' => '@^/west-branch-huron-river/west-branch-huron-river-falls/?@',  | 
                                                        |
| 67 | - 'replace' => '/west-branch-huron-river/west-branch-falls/'),  | 
                                                        |
| 68 | - (object) array(  | 
                                                        |
| 69 | - 'pattern' => '@^/west-branch-yellow-dog-river/west-branch-yellow-dog-falls/?@',  | 
                                                        |
| 70 | - 'replace' => '/west-branch-yellow-dog-river/west-branch-falls/'),  | 
                                                        |
| 71 | - (object) array(  | 
                                                        |
| 72 | - 'pattern' => '@^/baltimore-river/peanut-butter-falls/?@',  | 
                                                        |
| 73 | - 'replace' => '/baltimore-river/konteko-falls/'),  | 
                                                        |
| 74 | - );  | 
                                                        |
| 75 | - }  | 
                                                        |
| 38 | + (object) array(  | 
                                                        |
| 39 | + 'pattern' => '@^/about/([a-z]*)(/?)$@',  | 
                                                        |
| 40 | + 'replace' => '/about/'),  | 
                                                        |
| 41 | + (object) array(  | 
                                                        |
| 42 | + 'pattern' => '@^/birch-creek/birch-creek-falls/?$@',  | 
                                                        |
| 43 | + 'replace' => '/birch-creek/gold-mine-falls/'),  | 
                                                        |
| 44 | + (object) array(  | 
                                                        |
| 45 | + 'pattern' => '@^/big-iron-river/bonanza-falls/?$@',  | 
                                                        |
| 46 | + 'replace' => '/big-iron-river/greenwood-falls/'),  | 
                                                        |
| 47 | + (object) array(  | 
                                                        |
| 48 | + 'pattern' => '@^/east-branch-huron-river/east-branch-huron-river-falls/?$@',  | 
                                                        |
| 49 | + 'replace' => '/east-branch-huron-river/east-branch-falls/'),  | 
                                                        |
| 50 | + (object) array(  | 
                                                        |
| 51 | + 'pattern' => '@^/montreal-river/lower-montreal-falls/?$@',  | 
                                                        |
| 52 | + 'replace' => '/montreal-river/montreal-falls/'),  | 
                                                        |
| 53 | + (object) array(  | 
                                                        |
| 54 | + 'pattern' => '@^/manganese-creek/manganese-gorge-falls/?$@',  | 
                                                        |
| 55 | + 'replace' => '/manganese-creek/manganese-falls/'),  | 
                                                        |
| 56 | + (object) array(  | 
                                                        |
| 57 | + 'pattern' => '@^/dead-river/tourist-park-dam-falls/?$@',  | 
                                                        |
| 58 | + 'replace' => '/dead-river/tourist-park-falls/'),  | 
                                                        |
| 59 | + (object) array(  | 
                                                        |
| 60 | + 'pattern' => '@^/sturgeon-river/upper-sturgeon-falls/?$@',  | 
                                                        |
| 61 | + 'replace' => '/sturgeon-river/little-spruce-falls/'),  | 
                                                        |
| 62 | + (object) array(  | 
                                                        |
| 63 | + 'pattern' => '@^/tahquamenon-river/upper-tahquamenon-falls/?$@',  | 
                                                        |
| 64 | + 'replace' => '/tahquamenon-river/tahquamenon-falls/'),  | 
                                                        |
| 65 | + (object) array(  | 
                                                        |
| 66 | + 'pattern' => '@^/west-branch-huron-river/west-branch-huron-river-falls/?@',  | 
                                                        |
| 67 | + 'replace' => '/west-branch-huron-river/west-branch-falls/'),  | 
                                                        |
| 68 | + (object) array(  | 
                                                        |
| 69 | + 'pattern' => '@^/west-branch-yellow-dog-river/west-branch-yellow-dog-falls/?@',  | 
                                                        |
| 70 | + 'replace' => '/west-branch-yellow-dog-river/west-branch-falls/'),  | 
                                                        |
| 71 | + (object) array(  | 
                                                        |
| 72 | + 'pattern' => '@^/baltimore-river/peanut-butter-falls/?@',  | 
                                                        |
| 73 | + 'replace' => '/baltimore-river/konteko-falls/'),  | 
                                                        |
| 74 | + );  | 
                                                        |
| 75 | + }  | 
                                                        |
| 76 | 76 | |
| 77 | - protected function check_for_special_redirect($uri)  | 
                                                        |
| 78 | -	{ | 
                                                        |
| 77 | + protected function check_for_special_redirect($uri)  | 
                                                        |
| 78 | +    { | 
                                                        |
| 79 | 79 |          if (preg_match('@^/falls/([a-z\'-]+)(/?)$@', $uri, $matches)) { | 
                                                        
| 80 | 80 | $alias = $matches[1];  | 
                                                        
| 81 | 81 |              $alias = str_replace("'", '', $alias); | 
                                                        
@@ -128,81 +128,81 @@ discard block  | 
                                                    ||
| 128 | 128 | }  | 
                                                        
| 129 | 129 | }  | 
                                                        
| 130 | 130 | |
| 131 | - return $uri;  | 
                                                        |
| 132 | - }  | 
                                                        |
| 131 | + return $uri;  | 
                                                        |
| 132 | + }  | 
                                                        |
| 133 | 133 | |
| 134 | - protected function get_direct_array()  | 
                                                        |
| 135 | -	{ | 
                                                        |
| 136 | - return array(  | 
                                                        |
| 137 | - (object) array(  | 
                                                        |
| 138 | - 'match' => '/',  | 
                                                        |
| 139 | - 'controller' => 'HomeController'),  | 
                                                        |
| 140 | - (object) array(  | 
                                                        |
| 141 | - 'match' => '/falls/',  | 
                                                        |
| 142 | - 'controller' => 'WaterfallListController'),  | 
                                                        |
| 143 | - (object) array(  | 
                                                        |
| 144 | - 'match' => '/falls/([0-9]+)/',  | 
                                                        |
| 145 | - 'controller' => 'WaterfallListController'),  | 
                                                        |
| 146 | - (object) array(  | 
                                                        |
| 147 | - 'match' => '/([a-z]+)-county/',  | 
                                                        |
| 148 | - 'controller' => 'CountyListController'),  | 
                                                        |
| 149 | - (object) array(  | 
                                                        |
| 150 | - 'match' => '/([a-z]+)-county/([0-9]+)/',  | 
                                                        |
| 151 | - 'controller' => 'CountyListController'),  | 
                                                        |
| 152 | - (object) array(  | 
                                                        |
| 153 | - 'match' => '/([a-z0-9-]+)-(creek|river)/',  | 
                                                        |
| 154 | - 'controller' => 'WatercourseListController'),  | 
                                                        |
| 155 | - (object) array(  | 
                                                        |
| 156 | - 'match' => '/([a-z0-9-]+)-(creek|river)/([0-9]+)/',  | 
                                                        |
| 157 | - 'controller' => 'WatercourseListController'),  | 
                                                        |
| 158 | - (object) array(  | 
                                                        |
| 159 | - 'match' => '/category/([a-z]+)/',  | 
                                                        |
| 160 | - 'controller' => 'CategoryListController'),  | 
                                                        |
| 161 | - (object) array(  | 
                                                        |
| 162 | - 'match' => '/category/([a-z]+)/([0-9]+)/',  | 
                                                        |
| 163 | - 'controller' => 'CategoryListController'),  | 
                                                        |
| 164 | - (object) array(  | 
                                                        |
| 165 | - 'match' => '/([a-z0-9-]+)-(creek|river)/([a-z-]+)/',  | 
                                                        |
| 166 | - 'controller' => 'WaterfallController'),  | 
                                                        |
| 167 | - (object) array(  | 
                                                        |
| 168 | - 'match' => '/map/',  | 
                                                        |
| 169 | - 'controller' => 'MapController'),  | 
                                                        |
| 134 | + protected function get_direct_array()  | 
                                                        |
| 135 | +    { | 
                                                        |
| 136 | + return array(  | 
                                                        |
| 137 | + (object) array(  | 
                                                        |
| 138 | + 'match' => '/',  | 
                                                        |
| 139 | + 'controller' => 'HomeController'),  | 
                                                        |
| 140 | + (object) array(  | 
                                                        |
| 141 | + 'match' => '/falls/',  | 
                                                        |
| 142 | + 'controller' => 'WaterfallListController'),  | 
                                                        |
| 143 | + (object) array(  | 
                                                        |
| 144 | + 'match' => '/falls/([0-9]+)/',  | 
                                                        |
| 145 | + 'controller' => 'WaterfallListController'),  | 
                                                        |
| 146 | + (object) array(  | 
                                                        |
| 147 | + 'match' => '/([a-z]+)-county/',  | 
                                                        |
| 148 | + 'controller' => 'CountyListController'),  | 
                                                        |
| 149 | + (object) array(  | 
                                                        |
| 150 | + 'match' => '/([a-z]+)-county/([0-9]+)/',  | 
                                                        |
| 151 | + 'controller' => 'CountyListController'),  | 
                                                        |
| 152 | + (object) array(  | 
                                                        |
| 153 | + 'match' => '/([a-z0-9-]+)-(creek|river)/',  | 
                                                        |
| 154 | + 'controller' => 'WatercourseListController'),  | 
                                                        |
| 155 | + (object) array(  | 
                                                        |
| 156 | + 'match' => '/([a-z0-9-]+)-(creek|river)/([0-9]+)/',  | 
                                                        |
| 157 | + 'controller' => 'WatercourseListController'),  | 
                                                        |
| 158 | + (object) array(  | 
                                                        |
| 159 | + 'match' => '/category/([a-z]+)/',  | 
                                                        |
| 160 | + 'controller' => 'CategoryListController'),  | 
                                                        |
| 161 | + (object) array(  | 
                                                        |
| 162 | + 'match' => '/category/([a-z]+)/([0-9]+)/',  | 
                                                        |
| 163 | + 'controller' => 'CategoryListController'),  | 
                                                        |
| 164 | + (object) array(  | 
                                                        |
| 165 | + 'match' => '/([a-z0-9-]+)-(creek|river)/([a-z-]+)/',  | 
                                                        |
| 166 | + 'controller' => 'WaterfallController'),  | 
                                                        |
| 167 | + (object) array(  | 
                                                        |
| 168 | + 'match' => '/map/',  | 
                                                        |
| 169 | + 'controller' => 'MapController'),  | 
                                                        |
| 170 | 170 | (object) array(  | 
                                                        
| 171 | 171 | 'match' => '/map/#[a-z-/]+',  | 
                                                        
| 172 | 172 | 'controller' => 'MapController'),  | 
                                                        
| 173 | - (object) array(  | 
                                                        |
| 174 | - 'match' => '/journal/',  | 
                                                        |
| 175 | - 'controller' => 'LogListController'),  | 
                                                        |
| 176 | - (object) array(  | 
                                                        |
| 177 | - 'match' => '/journal/([0-9]+)/',  | 
                                                        |
| 178 | - 'controller' => 'LogListController'),  | 
                                                        |
| 179 | - (object) array(  | 
                                                        |
| 180 | - 'match' => '/journal/[a-z-]+/',  | 
                                                        |
| 181 | - 'controller' => 'LogController'),  | 
                                                        |
| 182 | - (object) array(  | 
                                                        |
| 183 | - 'match' => '/companion/([a-z-]+)/',  | 
                                                        |
| 184 | - 'controller' => 'CompanionListController'),  | 
                                                        |
| 185 | - (object) array(  | 
                                                        |
| 186 | - 'match' => '/companion/([a-z-]+)/([0-9]+)/',  | 
                                                        |
| 187 | - 'controller' => 'CompanionListController'),  | 
                                                        |
| 188 | - (object) array(  | 
                                                        |
| 189 | - 'match' => '/period/([a-z-]+)/',  | 
                                                        |
| 190 | - 'controller' => 'PeriodListController'),  | 
                                                        |
| 191 | - (object) array(  | 
                                                        |
| 192 | - 'match' => '/period/([a-z-]+)/([0-9]+)/',  | 
                                                        |
| 193 | - 'controller' => 'PeriodListController'),  | 
                                                        |
| 194 | - (object) array(  | 
                                                        |
| 195 | - 'match' => '/journal/tag/([a-z-]+)/',  | 
                                                        |
| 196 | - 'controller' => 'LogTagListController'),  | 
                                                        |
| 197 | - (object) array(  | 
                                                        |
| 198 | - 'match' => '/journal/tag/([a-z-]+)/([0-9]+)/',  | 
                                                        |
| 199 | - 'controller' => 'LogTagListController'),  | 
                                                        |
| 200 | - (object) array(  | 
                                                        |
| 201 | - 'match' => '/about/',  | 
                                                        |
| 202 | - 'controller' => 'AboutController'),  | 
                                                        |
| 203 | - (object) array(  | 
                                                        |
| 204 | - 'match' => '/contact/',  | 
                                                        |
| 205 | - 'controller' => 'ContactController'));  | 
                                                        |
| 206 | - }  | 
                                                        |
| 173 | + (object) array(  | 
                                                        |
| 174 | + 'match' => '/journal/',  | 
                                                        |
| 175 | + 'controller' => 'LogListController'),  | 
                                                        |
| 176 | + (object) array(  | 
                                                        |
| 177 | + 'match' => '/journal/([0-9]+)/',  | 
                                                        |
| 178 | + 'controller' => 'LogListController'),  | 
                                                        |
| 179 | + (object) array(  | 
                                                        |
| 180 | + 'match' => '/journal/[a-z-]+/',  | 
                                                        |
| 181 | + 'controller' => 'LogController'),  | 
                                                        |
| 182 | + (object) array(  | 
                                                        |
| 183 | + 'match' => '/companion/([a-z-]+)/',  | 
                                                        |
| 184 | + 'controller' => 'CompanionListController'),  | 
                                                        |
| 185 | + (object) array(  | 
                                                        |
| 186 | + 'match' => '/companion/([a-z-]+)/([0-9]+)/',  | 
                                                        |
| 187 | + 'controller' => 'CompanionListController'),  | 
                                                        |
| 188 | + (object) array(  | 
                                                        |
| 189 | + 'match' => '/period/([a-z-]+)/',  | 
                                                        |
| 190 | + 'controller' => 'PeriodListController'),  | 
                                                        |
| 191 | + (object) array(  | 
                                                        |
| 192 | + 'match' => '/period/([a-z-]+)/([0-9]+)/',  | 
                                                        |
| 193 | + 'controller' => 'PeriodListController'),  | 
                                                        |
| 194 | + (object) array(  | 
                                                        |
| 195 | + 'match' => '/journal/tag/([a-z-]+)/',  | 
                                                        |
| 196 | + 'controller' => 'LogTagListController'),  | 
                                                        |
| 197 | + (object) array(  | 
                                                        |
| 198 | + 'match' => '/journal/tag/([a-z-]+)/([0-9]+)/',  | 
                                                        |
| 199 | + 'controller' => 'LogTagListController'),  | 
                                                        |
| 200 | + (object) array(  | 
                                                        |
| 201 | + 'match' => '/about/',  | 
                                                        |
| 202 | + 'controller' => 'AboutController'),  | 
                                                        |
| 203 | + (object) array(  | 
                                                        |
| 204 | + 'match' => '/contact/',  | 
                                                        |
| 205 | + 'controller' => 'ContactController'));  | 
                                                        |
| 206 | + }  | 
                                                        |
| 207 | 207 | |
| 208 | 208 | }  |