Changeset 4961
- Timestamp:
- 09/03/07 11:41:03 (2 years ago)
- Files:
-
- trunk/lib/config/sfFactoryConfigHandler.class.php (modified) (5 diffs)
- trunk/lib/database/sfDatabaseManager.class.php (modified) (1 diff)
- trunk/lib/log/sfLogger.class.php (modified) (1 diff)
- trunk/lib/routing/sfRouting.class.php (modified) (1 diff)
- trunk/lib/storage/sfStorage.class.php (modified) (1 diff)
- trunk/lib/user/sfUser.class.php (modified) (2 diffs)
- trunk/lib/util/sfContext.class.php (modified) (2 diffs)
- trunk/lib/view/sfViewCacheManager.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/config/sfFactoryConfigHandler.class.php
r4957 r4961 113 113 case 'storage': 114 114 $defaultParameters = array(); 115 $defaultParameters[] = sprintf("' session_id' => \$this->getRequest()->getParameter('%s'),", $parameters['session_name']);115 $defaultParameters[] = sprintf("'auto_shutdown' => false, 'session_id' => \$this->getRequest()->getParameter('%s'),", $parameters['session_name']); 116 116 if (is_subclass_of($class, 'sfDatabaseSessionStorage')) 117 117 { … … 123 123 124 124 case 'user': 125 $instances[] = sprintf(" \$class = sfConfig::get('sf_factory_user', '%s');\n \$this->factories['user'] = new \$class(\$this->dispatcher, \$this->factories['storage'], array_merge(array(' culture' => \$this->factories['request']->getParameter('sf_culture'), 'default_culture' => sfConfig::get('sf_i18n_default_culture'), 'use_flash' => sfConfig::get('sf_use_flash')), sfConfig::get('sf_factory_user_parameters', %s)));", $class, var_export(is_array($parameters) ? $parameters : array(), true));125 $instances[] = sprintf(" \$class = sfConfig::get('sf_factory_user', '%s');\n \$this->factories['user'] = new \$class(\$this->dispatcher, \$this->factories['storage'], array_merge(array('auto_shutdown' => false, 'culture' => \$this->factories['request']->getParameter('sf_culture'), 'default_culture' => sfConfig::get('sf_i18n_default_culture'), 'use_flash' => sfConfig::get('sf_use_flash')), sfConfig::get('sf_factory_user_parameters', %s)));", $class, var_export(is_array($parameters) ? $parameters : array(), true)); 126 126 break; 127 127 … … 159 159 160 160 case 'routing': 161 $instances[] = sprintf(" \$class = sfConfig::get('sf_factory_routing', '%s');\n \$this->factories['routing'] = new \$class(\$this->dispatcher, array_merge(array(' suffix' => sfConfig::get('sf_suffix'), 'default_module' => sfConfig::get('sf_default_module'), 'default_action' => sfConfig::get('sf_default_action')), sfConfig::get('sf_factory_routing_parameters', %s)));", $class, var_export(is_array($parameters) ? $parameters : array(), true));161 $instances[] = sprintf(" \$class = sfConfig::get('sf_factory_routing', '%s');\n \$this->factories['routing'] = new \$class(\$this->dispatcher, array_merge(array('auto_shutdown' => false, 'suffix' => sfConfig::get('sf_suffix'), 'default_module' => sfConfig::get('sf_default_module'), 'default_action' => sfConfig::get('sf_default_action')), sfConfig::get('sf_factory_routing_parameters', %s)));", $class, var_export(is_array($parameters) ? $parameters : array(), true)); 162 162 if (isset($parameters['load_configuration']) && $parameters['load_configuration']) 163 163 { … … 193 193 { 194 194 // create logger instance 195 $loggers .= sprintf("\n\$logger = new %s(\$this->dispatcher, %s);\n\$this->factories['logger']->addLogger(\$logger);\n",195 $loggers .= sprintf("\n\$logger = new %s(\$this->dispatcher, array_merge(array('auto_shutdown' => false), %s));\n\$this->factories['logger']->addLogger(\$logger);\n", 196 196 $keys['class'], 197 isset($keys['param']) ? var_export($keys['param'], true) : ' '197 isset($keys['param']) ? var_export($keys['param'], true) : 'array()' 198 198 ); 199 199 } … … 204 204 205 205 $instances[] = sprintf( 206 " \$class = sfConfig::get('sf_factory_logger', '%s');\n \$this->factories['logger'] = new \$class(\$this->dispatcher, sfConfig::get('sf_factory_logger_parameters', %s));\n".206 " \$class = sfConfig::get('sf_factory_logger', '%s');\n \$this->factories['logger'] = new \$class(\$this->dispatcher, array_merge(array('auto_shutdown' => false), sfConfig::get('sf_factory_logger_parameters', %s)));\n". 207 207 " %s" 208 , $class, var_export( $parameters, true), $loggers);208 , $class, var_export(is_array($parameters) ? $parameters : array(), true), $loggers); 209 209 break; 210 210 } trunk/lib/database/sfDatabaseManager.class.php
r4957 r4961 31 31 * @see initialize() 32 32 */ 33 public function __construct( )33 public function __construct($options = array()) 34 34 { 35 35 $this->initialize(); 36 37 if (isset($options['auto_shutdown']) && $options['auto_shutdown']) 38 { 39 register_shutdown_function(array($this, 'shutdown')); 40 } 36 41 } 37 42 trunk/lib/log/sfLogger.class.php
r4957 r4961 49 49 { 50 50 $this->initialize($dispatcher, $options); 51 52 if (isset($options['auto_shutdown']) && $options['auto_shutdown']) 53 { 54 register_shutdown_function(array($this, 'shutdown')); 55 } 51 56 } 52 57 trunk/lib/routing/sfRouting.class.php
r4957 r4961 32 32 { 33 33 $this->initialize($dispatcher, $parameters); 34 35 if ($this->parameterHolder->get('auto_shutdown', true)) 36 { 37 register_shutdown_function(array($this, 'shutdown')); 38 } 34 39 } 35 40 trunk/lib/storage/sfStorage.class.php
r4957 r4961 32 32 { 33 33 $this->initialize($parameters); 34 35 if ($this->getParameter('auto_shutdown', true)) 36 { 37 register_shutdown_function(array($this, 'shutdown')); 38 } 34 39 } 35 40 trunk/lib/user/sfUser.class.php
r4957 r4961 47 47 { 48 48 $this->initialize($dispatcher, $storage, $parameters); 49 50 if ($this->getParameter('auto_shutdown', true)) 51 { 52 register_shutdown_function(array($this, 'shutdown')); 53 } 49 54 } 50 55 … … 229 234 230 235 /** 231 * Execute the shutdown procedure.236 * Executes the shutdown procedure. 232 237 * 233 238 * @return void trunk/lib/util/sfContext.class.php
r4957 r4961 41 41 { 42 42 // setup our database connections 43 $this->factories['databaseManager'] = new sfDatabaseManager( );43 $this->factories['databaseManager'] = new sfDatabaseManager(array('auto_shutdown' => false)); 44 44 } 45 45 … … 374 374 } 375 375 376 if (sfConfig::get('sf_cache'))377 {378 $this->getViewCacheManager()->shutdown();379 }380 381 376 if (sfConfig::get('sf_logging_enabled')) 382 377 { trunk/lib/view/sfViewCacheManager.class.php
r4957 r4961 650 650 return true; 651 651 } 652 653 /**654 * Executes the shutdown procedure.655 */656 public function shutdown()657 {658 }659 652 }

