Changeset 1811
- Timestamp:
- 03/01/07 19:28:41 (23 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/src/controller/AgaviController.class.php
r1713 r1811 30 30 * @version $Id$ 31 31 */ 32 class AgaviController 32 class AgaviController extends AgaviParameterHolder 33 33 { 34 34 /** … … 36 36 */ 37 37 protected $numExecutions = 0; 38 39 /**40 * @var int The maximum number of execution container runs allowed.41 */42 protected $maxExecutions = 20;43 38 44 39 /** … … 109 104 public function countExecution() 110 105 { 111 if(++$this->numExecutions > $this->maxExecutions && $this->maxExecutions > 0) { 106 $maxExecutions = $this->getParameter('max_executions'); 107 108 if(++$this->numExecutions > $maxExecutions && $maxExecutions > 0) { 112 109 throw new AgaviControllerException('Too many execution runs have been detected for this Context.'); 113 110 } … … 190 187 $response = $container->getResponse(); 191 188 $response->merge($this->response); 192 $response->send($container->getOutputType()); 189 190 if($this->getParameter('send_response')) { 191 $response->send($container->getOutputType()); 192 } 193 194 return $response; 193 195 194 196 } catch(Exception $e) { … … 326 328 327 329 /** 330 * Constructor. 331 * 332 * @author David Zülke <dz@bitxtender.com> 333 * @since 0.11.0 334 */ 335 public function __construct() 336 { 337 parent::__construct(); 338 $this->setParameters(array( 339 'max_executions' => 20, 340 'send_response' => true, 341 )); 342 } 343 344 /** 328 345 * Initialize this controller. 329 346 * … … 337 354 { 338 355 $this->context = $context; 356 357 $this->setParameters($parameters); 339 358 340 359 $rfi = $context->getFactoryInfo('response'); 341 360 $this->response = new $rfi["class"](); 342 361 $this->response->initialize($context, $rfi["parameters"]); 343 344 $this->maxExecutions = isset($parameters['max_executions']) ? $parameters['max_executions'] : 20;345 362 346 363 $cfg = AgaviConfig::get('core.config_dir') . '/output_types.xml';

