@@ -162,7 +162,7 @@ public function dispatch(CakeRequest $request, CakeResponse $response, $addition
162
162
));
163
163
}
164
164
165
- $ response = $ this ->_invoke ($ controller , $ request, $ response );
165
+ $ response = $ this ->_invoke ($ controller , $ request );
166
166
if (isset ($ request ->params ['return ' ])) {
167
167
return $ response ->body ();
168
168
}
@@ -174,18 +174,19 @@ public function dispatch(CakeRequest $request, CakeResponse $response, $addition
174
174
175
175
/**
176
176
* Initializes the components and models a controller will be using.
177
- * Triggers the controller action, and invokes the rendering if Controller::$autoRender is true and echo's the output.
178
- * Otherwise the return value of the controller action are returned.
177
+ * Triggers the controller action, and invokes the rendering if Controller::$autoRender
178
+ * is true and echo's the output. Otherwise the return value of the controller
179
+ * action are returned.
179
180
*
180
181
* @param Controller $controller Controller to invoke
181
182
* @param CakeRequest $request The request object to invoke the controller for.
182
- * @param CakeResponse $response The response object to receive the output
183
183
* @return CakeResponse the resulting response object
184
184
*/
185
- protected function _invoke (Controller $ controller , CakeRequest $ request, CakeResponse $ response ) {
185
+ protected function _invoke (Controller $ controller , CakeRequest $ request ) {
186
186
$ controller ->constructClasses ();
187
187
$ controller ->startupProcess ();
188
188
189
+ $ response = $ controller ->response ;
189
190
$ render = true ;
190
191
$ result = $ controller ->invokeAction ($ request );
191
192
if ($ result instanceof CakeResponse) {
0 commit comments