Commit 34524a52 authored by Fabien Potencier's avatar Fabien Potencier

changed debug to have a sensible default in all providers

parent 18b6050b
......@@ -31,7 +31,7 @@ class HttpCacheServiceProvider implements ServiceProviderInterface, EventListene
$app['http_cache'] = $app->share(function ($app) {
$app['http_cache.options'] = array_replace(
array(
'debug' => $app['debug'],
'debug' => isset($app['debug']) ? $app['debug'] : false,
), $app['http_cache.options']
);
......
......@@ -31,7 +31,7 @@ class HttpFragmentServiceProvider implements ServiceProviderInterface, EventList
public function register(\Pimple $app)
{
$app['fragment.handler'] = $app->share(function ($app) {
return new FragmentHandler($app['fragment.renderers'], $app['debug'], $app['request_stack']);
return new FragmentHandler($app['fragment.renderers'], isset($app['debug']) ? $app['debug'] : false, $app['request_stack']);
});
$app['fragment.renderer.inline'] = $app->share(function ($app) {
......
......@@ -50,7 +50,7 @@ class MonologServiceProvider implements ServiceProviderInterface, BootableProvid
$log->pushHandler($app['monolog.handler']);
if ($app['debug'] && isset($app['monolog.handler.debug'])) {
if (isset($app['debug']) && $app['debug'] && isset($app['monolog.handler.debug'])) {
$log->pushHandler($app['monolog.handler.debug']);
}
......
......@@ -38,15 +38,15 @@ class TwigServiceProvider implements ServiceProviderInterface
$app['twig.options'] = array_replace(
array(
'charset' => $app['charset'],
'debug' => $app['debug'],
'strict_variables' => $app['debug'],
'debug' => isset($app['debug']) ? $app['debug'] : false,
'strict_variables' => isset($app['debug']) ? $app['debug'] : false,
), $app['twig.options']
);
$twig = new \Twig_Environment($app['twig.loader'], $app['twig.options']);
$twig->addGlobal('app', $app);
if ($app['debug']) {
if (isset($app['debug']) && $app['debug']) {
$twig->addExtension(new \Twig_Extension_Debug());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment