Skip to content

Commit 79390c4

Browse files
new version with raven-js CDN switch
1 parent 75569a1 commit 79390c4

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

Module.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ protected function setupExceptionLogging(MvcEvent $event)
217217
protected function setupJavascriptLogging(MvcEvent $event)
218218
{
219219
$viewHelper = $event->getApplication()->getServiceManager()->get('ViewHelperManager')->get('headscript');
220-
$viewHelper->offsetSetFile(0, '//cdn.ravenjs.com/3.17.0/raven.min.js');
220+
$useRavenjsCDN = $this->config['zend-sentry']['use-ravenjs-cdn'];
221+
if (!isset($useRavenjsCDN) || $useRavenjsCDN) {
222+
$viewHelper->offsetSetFile(0, '//cdn.ravenjs.com/3.17.0/raven.min.js');
223+
}
221224
$publicApiKey = $this->convertKeyToPublic($this->config['zend-sentry']['sentry-api-key']);
222225
$ravenjsConfig = json_encode($this->config['zend-sentry']['ravenjs-config']);
223226
$viewHelper->offsetSetScript(1, sprintf("if (typeof Raven !== 'undefined') Raven.config('%s', %s).install()", $publicApiKey, $ravenjsConfig));

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Scrutizier analysis: [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/c
44

55
ZendSentry is released under the New BSD License.
66

7-
The current version of ZendSentry for ZF3 is `3.3.1`. It supports Zend Framework >= 3.0. For other versions see tags in the 1.* series as well as 2.* series.
7+
The current version of ZendSentry for ZF3 is `3.4.0`. It supports Zend Framework >= 3.0. For other versions see tags in the 1.* series as well as 2.* series.
88

99
# Important Changes
10+
- 3.4.0: Add possibility to switch off usage of raven-js CDN
1011
- 3.3.0: Add possibility to pass config options to ravenjs
1112
- 3.2.0: Upgrade dependencies to `sentry/sentry` 1.7.0 and `ravenjs` 3.17.0
1213
- 3.0.1: ViewHelper fix
@@ -47,7 +48,7 @@ In your project's `composer.json` use:
4748

4849
{
4950
"require": {
50-
"cloud-solutions/zend-sentry": "3.3.1"
51+
"cloud-solutions/zend-sentry": "3.4.0"
5152
}
5253

5354
Run `php composer.phar update` to download it into your vendor folder and setup autoloading.
@@ -217,13 +218,20 @@ Just for the record, a copy of the actual global configuration options:
217218
'handle-javascript-errors' => true,
218219

219220
/**
220-
* Set raven config options here.
221+
* Should ZendSentry load raven-js via CDN?
222+
* If you set this to false you'll need to make sure to load raven-js some other way.
223+
*/
224+
'use-ravenjs-cdn' => true,
225+
226+
/**
227+
* Set raven config options for the getsentry/sentry-php package here.
221228
* Raven has sensible defaults set in Raven_Client, if you need to override them, this is where you can do it.
222229
*/
223230
'raven-config' => array(),
224-
231+
225232
/**
226-
* Set ravenjs config options here, will be passed along with json_encode
233+
* Set ravenjs config options for the getsentry/raven-js package here.
234+
* This will be json encoded and passed to raven-js when doing Raven.install().
227235
*/
228236
'ravenjs-config' => array(),
229237

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": ["log", "logging", "sentry", "raven", "zend-framework"],
55
"homepage": "https://github.com/cloud-solutions/zend-sentry",
66
"type": "library",
7-
"version": "3.3.1",
7+
"version": "3.4.0",
88
"license": "New BSD License",
99
"authors": [
1010
{

config/zend-sentry.global.php.dist

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,22 @@ $settings = array(
6868
'handle-javascript-errors' => true,
6969

7070
/**
71-
* Set raven config options here.
71+
* Should ZendSentry load raven-js via CDN?
72+
* If you set this to false you'll need to make sure to load raven-js some other way.
73+
*/
74+
'use-ravenjs-cdn' => true,
75+
76+
/**
77+
* Set raven config options for the getsentry/sentry-php package here.
7278
* Raven has sensible defaults set in Raven_Client, if you need to override them, this is where you can do it.
7379
*/
7480
'raven-config' => array(),
81+
82+
/**
83+
* Set ravenjs config options for the getsentry/raven-js package here.
84+
* This will be json encoded and passed to raven-js when doing Raven.install().
85+
*/
86+
'ravenjs-config' => array(),
7587
);
7688

7789
/**

0 commit comments

Comments
 (0)