Skip to content

Commit

Permalink
Merge branch 'master' into releases/1.9.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/Raven/Client.php
  • Loading branch information
stayallive committed Jun 19, 2018
2 parents c90567d + e13fa17 commit 59a15da
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

- ...

## 1.9.1 (2018-06-19)

- Allow the use of a public DSN (private part of the DSN was deprecated in Sentry 9) (#615)
- Send transaction as transaction not as culprit (#601)

## 1.9.0 (2018-05-03)

- Fixed undefined variable (#588)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,28 @@ Tagging a Release
2. Create a new branch for the minor version (if not present):

```
$ git checkout -b releases/1.9.x
$ git checkout -b releases/1.10.x
```

3. Update the hardcoded version tag in ``Client.php``:

```php
class Raven_Client
{
const VERSION = '1.9.0';
const VERSION = '1.10.0';
}
```

4. Commit the change:

```
$ git commit -a -m "1.9.0"
$ git commit -a -m "1.10.0"
```

5. Tag the branch:

```
git tag 1.9.0
git tag 1.10.0
```

6. Push the tag:
Expand All @@ -137,15 +137,15 @@ git checkout master
8. Add the next minor release to the ``CHANGES`` file:

```
## 1.10.0 (unreleased)
## 1.11.0 (unreleased)
```

9. Update the version in ``Client.php``:

```php
class Raven_Client
{
const VERSION = '1.10.x-dev';
const VERSION = '1.11.x-dev';
}
```

Expand All @@ -154,7 +154,7 @@ class Raven_Client
```json
"extra": {
"branch-alias": {
"dev-master": "1.10.x-dev"
"dev-master": "1.11.x-dev"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.9.x-dev"
"dev-master": "1.10.x-dev"
}
}
}
6 changes: 4 additions & 2 deletions docs/integrations/laravel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Add your DSN to ``.env``:

.. code-block:: bash
SENTRY_DSN=___DSN___
SENTRY_LARAVEL_DSN=___DSN___
Finally, if you wish to wire up User Feedback, you can do so by creating a custom
error view in `resources/views/errors/500.blade.php`.
Expand Down Expand Up @@ -124,9 +124,11 @@ Laravel 4.x

Install the ``sentry/sentry-laravel`` package:

Laravel 4.x is supported until version 0.8.x.

.. code-block:: bash
$ composer require sentry/sentry-laravel
$ composer require "sentry/sentry-laravel:0.8.*"
Add the Sentry service provider and facade in ``config/app.php``:

Expand Down
6 changes: 3 additions & 3 deletions lib/Raven/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function install()
$this->error_handler->registerExceptionHandler();
$this->error_handler->registerErrorHandler();
$this->error_handler->registerShutdownFunction();

if ($this->_curl_handler) {
$this->_curl_handler->registerShutdownFunction();
}
Expand Down Expand Up @@ -508,7 +508,7 @@ public static function parseDSN($dsn)
}
$username = (isset($url['user']) ? $url['user'] : null);
$password = (isset($url['pass']) ? $url['pass'] : null);
if (empty($netloc) || empty($project) || empty($username) || empty($password)) {
if (empty($netloc) || empty($project) || empty($username)) {
throw new InvalidArgumentException('Invalid Sentry DSN: ' . $dsn);
}

Expand Down Expand Up @@ -832,7 +832,7 @@ public function get_default_data()
'tags' => $this->tags,
'platform' => 'php',
'sdk' => $this->sdk,
'culprit' => $this->transaction->peek(),
'transaction' => $this->transaction->peek(),
);
}

Expand Down
41 changes: 33 additions & 8 deletions test/Raven/Tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,15 @@ public function testParseDSNMissingPublicKey()
{
Raven_Client::ParseDSN('http://:secret@example.com/1');
}
/**
* @expectedException InvalidArgumentException
*/

public function testParseDSNMissingSecretKey()
{
Raven_Client::ParseDSN('http://public@example.com/1');
$parsed = Raven_Client::ParseDSN('http://public@example.com/1');

$this->assertEquals('http://example.com/api/1/store/', $parsed['server']);
$this->assertEquals('1', $parsed['project']);
$this->assertEquals('public', $parsed['public_key']);
$this->assertEquals(null, $parsed['secret_key']);
}

/**
Expand Down Expand Up @@ -680,11 +683,11 @@ public function testCaptureExceptionHandlesOptionsAsSecondArg()
{
$client = new Dummy_Raven_Client();
$ex = $this->create_exception();
$client->captureException($ex, array('culprit' => 'test'));
$client->captureException($ex, array('transaction' => 'test'));
$events = $client->getSentEvents();
$this->assertEquals(1, count($events));
$event = array_pop($events);
$this->assertEquals('test', $event['culprit']);
$this->assertEquals('test', $event['transaction']);
}

/**
Expand Down Expand Up @@ -828,7 +831,7 @@ public function testGetDefaultData()
'name' => 'sentry-php',
'version' => $client::VERSION,
),
'culprit' => 'test',
'transaction' => 'test',
);
$this->assertEquals($expected, $client->get_default_data());
}
Expand Down Expand Up @@ -1035,6 +1038,29 @@ public function testGet_Auth_Header()
"sentry_key=publickey, sentry_secret=secretkey";

$this->assertEquals($expected, $client->get_auth_header($timestamp, 'sentry-php/test', 'publickey', 'secretkey'));

$expected = "Sentry sentry_timestamp={$timestamp}, sentry_client={$clientstring}, " .
"sentry_version=" . Dummy_Raven_Client::PROTOCOL . ", " .
"sentry_key=publickey";

$this->assertEquals($expected, $client->get_auth_header($timestamp, 'sentry-php/test', 'publickey', null));
}

/**
* @covers Raven_Client::get_auth_header
*/
public function testGet_Auth_Header_Public()
{
$client = new Dummy_Raven_Client();

$clientstring = 'sentry-php/test';
$timestamp = '1234341324.340000';

$expected = "Sentry sentry_timestamp={$timestamp}, sentry_client={$clientstring}, " .
"sentry_version=" . Dummy_Raven_Client::PROTOCOL . ", " .
"sentry_key=publickey";

$this->assertEquals($expected, $client->get_auth_header($timestamp, 'sentry-php/test', 'publickey', null));
}

/**
Expand Down Expand Up @@ -2576,7 +2602,6 @@ public function testCaptureNonEmptyBreadcrumb()
), $event['breadcrumbs']);
}


/**
* @covers Raven_Client::capture
*/
Expand Down

0 comments on commit 59a15da

Please sign in to comment.