$app = 'frontend' ; $currentApp = sfConfig::get('sf_app') ; sfConfig::set('foo', 'bar') ; sfContext::getInstance()->getLogger()->info('Foo = ' . sfConfig::get('foo') . ' in ' . $currentApp) ; // display bar if ($app != $currentApp) { sfContext::getInstance()->switchTo($app); $currentRoutes = sfContext::getInstance()->getRouting()->getRoutes() ; } sfContext::getInstance()->getLogger()->info('Foo = ' . sfConfig::get('foo') . ' in ' . $app) ; // display bar sfConfig::set('foo', 'baz') ; sfContext::getInstance()->getLogger()->info('Foo = ' . sfConfig::get('foo') . ' in ' . $app) ; // display baz /* Reset the app switch if needed */ if ($app != $currentApp) { sfContext::getInstance()->switchTo($currentApp); $currentRoutes = sfContext::getInstance()->getRouting()->getRoutes() ; } sfContext::getInstance()->getLogger()->info('Foo = ' . sfConfig::get('foo') . ' in ' . $currentApp) ; // display nothing !!!