|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62862 Yaf_Plugin_Abstract::preResponse method is never executed
Submitted: 2012-08-19 05:06 UTC Modified: 2012-08-19 10:38 UTC
From: mzsolti at gmail dot com Assigned:
Status: Not a bug Package: yaf (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mzsolti at gmail dot com
New email:
PHP Version: OS:


 [2012-08-19 05:06 UTC] mzsolti at gmail dot com
Creating a plugin from Yaf_Plugin_Abstract and registering it at the dispatcher, 
will not have the preResponse method executed.

Test script:
$config = array(
	"application" => array(
		"directory" => realpath(dirname(__FILE__)),
		"dispatcher" => array(
			"catchException" => 0,
			"throwException" => 1,
        "modules" => "module",

class ControllerController extends Yaf_Controller_Abstract {
    public function indexAction() {
        echo 'indexAction in Controller';

class UserPlugin extends Yaf_Plugin_Abstract{
    public function preResponse($request, $response) {
		echo "preResponse in Plugin".PHP_EOL;

$app = new Yaf_Application($config);
$request = new Yaf_Request_Http("/module/controller/index");
$dispatcher = $app->getDispatcher();
$user = new UserPlugin();
try {
} catch (Yaf_Exception $e) {
  echo $e->getMessage(), "\n";

Expected result:
preResponse in Plugin
indexAction in Controller

Actual result:
indexAction in Controller


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-19 10:38 UTC]
preResponse is same as dispatchLoopShutdown,  so, it was removed later...  should 
be a doc problem
 [2012-08-19 10:38 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 16:01:31 2024 UTC