Skip to content
This repository
  • 3 commits
  • 1 file changed
  • 0 comments
  • 1 contributor
Feb 10, 2012
Josh Lockhart Merge branch 'hotfix-default-app-updates' into release-1.6.0 314e1c8
Josh Lockhart Apply flash, exception, method override middleware in Slim::run, not …
…in constructor

This ensures these middleware layers will always be the outer-most layers

Exceptions will now bubble up through the entire middleware stack
382c809
Josh Lockhart Resolve merge conflicts with middleware stack order updates d41a895

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 Slim/Slim.php
10 Slim/Slim.php
@@ -140,12 +140,7 @@ public function __construct( $userSettings = array() ) {
140 140 $this->request = new Slim_Http_Request($this->environment);
141 141 $this->response = new Slim_Http_Response();
142 142 $this->router = new Slim_Router($this->request, $this->response);
143   -
144   - //Assign default middleware
145 143 $this->middleware = array($this);
146   - $this->add('Slim_Middleware_Flash');
147   - $this->add('Slim_Middleware_MethodOverride');
148   - $this->add('Slim_Middleware_PrettyExceptions');
149 144
150 145 //Determine application mode
151 146 $this->getMode();
@@ -1144,6 +1139,11 @@ public function add( $className, $settings = array() ) {
1144 1139 public function run() {
1145 1140 set_error_handler(array('Slim', 'handleErrors'));
1146 1141
  1142 + //Apply final outer middleware layers
  1143 + $this->add('Slim_Middleware_Flash');
  1144 + $this->add('Slim_Middleware_MethodOverride');
  1145 + $this->add('Slim_Middleware_PrettyExceptions');
  1146 +
1147 1147 //Fetch status, header, and body
1148 1148 list($status, $header, $body) = $this->middleware[0]->call($this->environment);
1149 1149

No commit comments for this range

Something went wrong with that request. Please try again.