diff --git a/composer.json b/composer.json index 1a58b395..676e3345 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "php": ">=5.3.3", - "sentry/sentry": ">=1.2.0", + "sentry/sentry": ">=1.5.0", "symfony/symfony": ">=2.4.0" }, "require-dev": { diff --git a/src/Sentry/SentryBundle/DependencyInjection/Configuration.php b/src/Sentry/SentryBundle/DependencyInjection/Configuration.php index c351fe7c..68796df4 100644 --- a/src/Sentry/SentryBundle/DependencyInjection/Configuration.php +++ b/src/Sentry/SentryBundle/DependencyInjection/Configuration.php @@ -23,7 +23,7 @@ public function getConfigTreeBuilder() $rootNode ->children() ->scalarNode('app_path') - ->defaultValue('%kernel.root_dir%') + ->defaultValue('%kernel.root_dir%/..') ->end() ->scalarNode('client') ->defaultValue('Sentry\SentryBundle\SentrySymfonyClient') @@ -50,6 +50,11 @@ public function getConfigTreeBuilder() ->treatNullLike(array()) ->defaultValue(array('%kernel.root_dir%/..')) ->end() + ->arrayNode('excluded_app_paths') + ->prototype('scalar')->end() + ->treatNullLike(array()) + ->defaultValue(array('%kernel.root_dir%/../vendor')) + ->end() ->end() ; diff --git a/src/Sentry/SentryBundle/Resources/config/services.yml b/src/Sentry/SentryBundle/Resources/config/services.yml index 27c8eb9d..469d52ef 100644 --- a/src/Sentry/SentryBundle/Resources/config/services.yml +++ b/src/Sentry/SentryBundle/Resources/config/services.yml @@ -6,6 +6,7 @@ services: - [setRelease, ['%sentry.release%']] - [setEnvironment, ['%sentry.environment%']] - [setAppPath, ['%sentry.app_path%']] + - [setExcludedAppPaths, ['%sentry.excluded_app_paths%']] - [setPrefixes, ['%sentry.prefixes%']] - [install, []] diff --git a/test/Sentry/SentryBundle/Test/DependencyInjection/ExtensionTest.php b/test/Sentry/SentryBundle/Test/DependencyInjection/ExtensionTest.php index 9de73204..366e72c7 100644 --- a/test/Sentry/SentryBundle/Test/DependencyInjection/ExtensionTest.php +++ b/test/Sentry/SentryBundle/Test/DependencyInjection/ExtensionTest.php @@ -9,12 +9,12 @@ class ExtensionTest extends \PHPUnit_Framework_TestCase { const CONFIG_ROOT = 'sentry'; - public function test_that_it_uses_kernel_root_as_app_path_by_default() + public function test_that_it_uses_kernel_root_parent_as_app_path_by_default() { $container = $this->getContainer(); $this->assertSame( - 'kernel/root', + 'kernel/root/..', $container->getParameter('sentry.app_path') ); } @@ -33,6 +33,16 @@ public function test_that_it_uses_app_path_value() ); } + public function test_vendor_in_default_excluded_paths() + { + $container = $this->getContainer(); + + $this->assertContains( + 'kernel/root/../vendor', + $container->getParameter('sentry.excluded_app_paths') + ); + } + public function test_that_it_uses_defined_class_as_client_class_by_default() { $container = $this->getContainer();