Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Sentry/SentryBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public function getConfigTreeBuilder()
->scalarNode('dsn')
->defaultNull()
->end()
->arrayNode('options')
->treatNullLike(array())
->prototype('scalar')->end()
->defaultValue(array())
->end()
->scalarNode('error_types')
->defaultNull()
->end()
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/SentryBundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
sentry.client:
class: '%sentry.client%'
arguments: ['%sentry.dsn%', {'error_types': '%sentry.error_types%'}]
arguments: ['%sentry.dsn%', %sentry.options%, '%sentry.error_types%']
calls:
- [setRelease, ['%sentry.release%']]
- [setEnvironment, ['%sentry.environment%']]
Expand Down
6 changes: 3 additions & 3 deletions src/Sentry/SentryBundle/SentrySymfonyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

class SentrySymfonyClient extends \Raven_Client
{
public function __construct($dsn=null, $options=array())
public function __construct($dsn=null, $options=array(), $error_types='')
{
if (array_key_exists('error_types', $options)) {
$exParser = new ErrorTypesParser($options['error_types']);
if (is_string($error_types) && !empty($error_types)) {
$exParser = new ErrorTypesParser($error_types);
$options['error_types'] = $exParser->parse();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ public function test_that_it_uses_dsn_value()
);
}

public function test_that_it_uses_options_value()
{
$container = $this->getContainer(array(
static::CONFIG_ROOT => array(
'options' => array(
'http_proxy' => 'http://user:password@host:port'
),
),
));

$options = $container->getParameter('sentry.options');

$this->assertSame(
'http://user:password@host:port',
$options['http_proxy']
);
}

public function test_that_it_uses_defined_class_as_exception_listener_class_by_default()
{
$container = $this->getContainer();
Expand Down