lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
/**
	 * This is being run in normal order before the controller is being
	 * called which allows several modifications and checks
	 *
	 * @param Controller $controller the controller that is being called
	 * @param string $methodName the name of the method that will be called on
	 *                           the controller
	 */
This is being run in normal order before the controller is being
called which allows several modifications and checks

@param Controller $controller the controller that is being called
@param string $methodName the name of the method that will be called on
the controller
This is being run in normal order before the controller is being called which allows several modifications and checks @param Controller $controller the controller that is being called @param string $methodName the name of the method that will be called on the controller
public function beforeController(Controller $controller, $methodName){
		$middlewareCount = count($this->middlewares);
		for($i = 0; $i < $middlewareCount; $i++){
			$this->middlewareCounter++;
			$middleware = $this->middlewares[$i];
			$middleware->beforeController($controller, $methodName);
		}
	}
public function beforeController ( Controller $ controller , $ methodName ) { $ middlewareCount = count ( $ this -> middlewares ) ; for ( $ i = 0 ; $ i < $ middlewareCount ; $ i ++ ) { $ this -> middlewareCounter ++ ; $ middleware = $ this -> middlewares [ $ i ] ; $ middleware -> beforeController ( $ controller , $ methodName ) ; } }
This is being run in normal order before the controller is being
 called which allows several modifications and checks
This is being run in normal order before the controller is being called which allows several modifications and checks
// we need to count so that we know which middlewares we have to ask in // case there is an exception