Development

/branches/1.0/lib/filter/sfRenderingFilter.class.php

You must first sign up to be able to contribute.

root/branches/1.0/lib/filter/sfRenderingFilter.class.php

Revision 6648, 1.7 kB (checked in by fabien, 6 years ago)

fixed call to undefined method sfResponse::sendHttpHeaders (closes #2412)

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfRenderingFilter is the last filter registered for each filter chain. This
13  * filter does the rendering.
14  *
15  * @package    symfony
16  * @subpackage filter
17  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
18  * @version    SVN: $Id$
19  */
20 class sfRenderingFilter extends sfFilter
21 {
22   /**
23    * Executes this filter.
24    *
25    * @param sfFilterChain The filter chain.
26    *
27    * @throws <b>sfInitializeException</b> If an error occurs during view initialization
28    * @throws <b>sfViewException</b>       If an error occurs while executing the view
29    */
30   public function execute($filterChain)
31   {
32     // execute next filter
33     $filterChain->execute();
34
35     if (sfConfig::get('sf_logging_enabled'))
36     {
37       $this->getContext()->getLogger()->info('{sfFilter} render to client');
38     }
39
40     // get response object
41     $response = $this->getContext()->getResponse();
42
43     // send headers
44     if (method_exists($response, 'sendHttpHeaders'))
45     {
46       $response->sendHttpHeaders();
47     }
48
49     // send content
50     $response->sendContent();
51
52     // log timers information
53     if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled'))
54     {
55       $logger = $this->getContext()->getLogger();
56       foreach (sfTimerManager::getTimers() as $name => $timer)
57       {
58         $logger->info(sprintf('{sfTimerManager} %s %.2f ms (%d)', $name, $timer->getElapsedTime() * 1000, $timer->getCalls()));
59       }
60     }
61   }
62 }
63
Note: See TracBrowser for help on using the browser.