public function initialize(sfApplicationConfiguration $configuration)
{
$this->configuration = $configuration;
$this->dispatcher = $configuration->getEventDispatcher();
try {
$this->loadFactories();
} catch (sfException $e) {
$e->printStackTrace();
} catch (Exception $e) {
sfException::createFromException($e)->printStackTrace();
}
$this->dispatcher->connect('template.filter_parameters', array($this, 'filterTemplateParameters'));
$this->dispatcher->connect('response.fastcgi_finish_request', array($this, 'shutdownUserAndStorage'));
// register our shutdown function
register_shutdown_function(array($this, 'shutdown'));
}