Skip to content

Commit

Permalink
Merge pull request #1 from matyx/raven-config
Browse files Browse the repository at this point in the history
Add possibility to set raven config
  • Loading branch information
matyx authored Feb 4, 2017
2 parents 9373038 + 3e577a5 commit 2d1e66c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ extensions:


sentry:
dsn: https://__REPLACE_WITH_SENTRY_PROJECT_DSN__
dsn: https://__REPLACE_WITH_SENTRY_PROJECT_DSN__
ravenConfig:
name: example.com
```
6 changes: 5 additions & 1 deletion src/Matyx/Sentry/SentryExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ public function beforeCompile() {
return;
}

if(!isset($config['ravenConfig'])) {
$config['ravenConfig'] = [];
}

$builder = $this->getContainerBuilder();

$builder->addDefinition($this->prefix('ravenClient'))->setClass(\Raven_Client::class, [$config['dsn']]);
$builder->addDefinition($this->prefix('ravenClient'))->setClass(\Raven_Client::class, [$config['dsn'], $config['ravenConfig']]);
}

public function afterCompile(Nette\PhpGenerator\ClassType $class) {
Expand Down

0 comments on commit 2d1e66c

Please sign in to comment.