Changeset 6662
- Timestamp:
- 12/21/07 08:22:20 (2 years ago)
- Files:
-
- branches/1.1/lib/config/sfFactoryConfigHandler.class.php (modified) (1 diff)
- branches/1.1/lib/controller/sfController.class.php (modified) (1 diff)
- branches/1.1/lib/response/sfResponse.class.php (modified) (1 diff)
- branches/1.1/lib/response/sfWebResponse.class.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/config/sfFactoryConfigHandler.class.php
r6661 r6662 106 106 107 107 case 'response': 108 $parameters = array_merge(array('charset' => sfConfig::get('sf_charset'), 'logging' => sfConfig::get('sf_logging_enabled')), is_array($parameters) ? $parameters : array()); 108 109 $instances[] = sprintf(" \$class = sfConfig::get('sf_factory_response', '%s');\n \$this->factories['response'] = new \$class(\$this->dispatcher, sfConfig::get('sf_factory_response_parameters', %s));", $class, var_export($parameters, true)); 109 110 branches/1.1/lib/controller/sfController.class.php
r6499 r6662 251 251 $this->context->getEventDispatcher()->notify(new sfEvent($this, 'controller.change_action', array('module' => $moduleName, 'action' => $actionName))); 252 252 253 if ($moduleName == sfConfig::get('sf_error_404_module') && $actionName == sfConfig::get('sf_error_404_action')) 254 { 255 $this->context->getResponse()->setStatusCode(404); 256 $this->context->getResponse()->setHttpHeader('Status', '404 Not Found'); 257 258 $this->dispatcher->notify(new sfEvent($this, 'controller.page_not_found', array('module' => $moduleName, 'action' => $actionName))); 259 } 260 253 261 // process the filter chain 254 262 $filterChain->execute(); branches/1.1/lib/response/sfResponse.class.php
r6509 r6662 81 81 $content = $event->getReturnValue(); 82 82 83 if ( sfConfig::get('sf_logging_enabled'))83 if ($this->getParameter('logging')) 84 84 { 85 85 $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send content (%s o)', strlen($content))))); branches/1.1/lib/response/sfWebResponse.class.php
r6650 r6662 47 47 { 48 48 parent::initialize($dispatcher, $parameters); 49 50 $this->dispatcher->connect('controller.change_action', array($this, 'listenToChangeActionEvent'));51 49 52 50 $this->statusTexts = array( … … 251 249 if (false === stripos($value, 'charset')) 252 250 { 253 $value .= '; charset='. sfConfig::get('sf_charset');251 $value .= '; charset='.$this->getParameter('charset'); 254 252 } 255 253 … … 264 262 public function getContentType() 265 263 { 266 return $this->getHttpHeader('Content-Type', 'text/html; charset='. sfConfig::get('sf_charset'));264 return $this->getHttpHeader('Content-Type', 'text/html; charset='.$this->getParameter('charset')); 267 265 } 268 266 … … 282 280 header($status); 283 281 284 if ( sfConfig::get('sf_logging_enabled'))282 if ($this->getParameter('logging')) 285 283 { 286 284 $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send status "%s"', $status)))); … … 292 290 header($name.': '.$value); 293 291 294 if ($value != '' && sfConfig::get('sf_logging_enabled'))292 if ($value != '' && $this->getParameter('logging')) 295 293 { 296 294 $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send header "%s": "%s"', $name, $value)))); … … 310 308 } 311 309 312 if ( sfConfig::get('sf_logging_enabled'))310 if ($this->getParameter('logging')) 313 311 { 314 312 $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send cookie "%s": "%s"', $cookie['name'], $cookie['value'])))); … … 508 506 if ($escape) 509 507 { 510 $value = htmlentities($value, ENT_QUOTES, sfConfig::get('sf_charset'));508 $value = htmlentities($value, ENT_QUOTES, $this->getParameter('charset')); 511 509 } 512 510 … … 699 697 list($this->content, $this->statusCode, $this->statusText, $this->parameterHolder, $this->cookies, $this->headerOnly, $this->headers, $this->metas, $this->httpMetas, $this->stylesheets, $this->javascripts, $this->slots) = $data; 700 698 } 701 702 /**703 * Listens to the controller.change_action event.704 *705 * @param sfEvent An sfEvent instance706 *707 */708 public function listenToChangeActionEvent(sfEvent $event)709 {710 $moduleName = $event['module'];711 $actionName = $event['action'];712 713 if ($moduleName == sfConfig::get('sf_error_404_module') && $actionName == sfConfig::get('sf_error_404_action'))714 {715 $this->setStatusCode(404);716 $this->setHttpHeader('Status', '404 Not Found');717 718 $this->dispatcher->notify(new sfEvent($this, 'controller.page_not_found', array('module' => $moduleName, 'action' => $actionName)));719 }720 }721 699 }

