Skip to content

Commit e377ccb

Browse files
authored
Merge pull request #190 from getsentry/use-sdk-metapackage
Use SDK metapackage
2 parents 6f7d6cd + c5ca873 commit e377ccb

File tree

3 files changed

+33
-16
lines changed

3 files changed

+33
-16
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Symfony integration for [Sentry](https://getsentry.com/).
1515
>
1616
> A beta version will be tagged as soon as possible, in the meantime you can continue to use the previous versions.
1717
>
18-
> To know more about the progress of this version see [the relative
19-
milestone](https://github.com/getsentry/sentry-symfony/milestone/3)
18+
> To know more about the progress of this version see [the relative milestone](https://github.com/getsentry/sentry-symfony/milestone/3)
2019
2120
## Benefits
2221

@@ -35,21 +34,32 @@ Use sentry-symfony for:
3534
## Installation
3635

3736
### Step 1: Download the Bundle
38-
You can install this bundle using Composer. Since the Sentry SDK uses HTTPlug to remain transport-agnostic, you need to
39-
manually require two additional packages that provides [`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
40-
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).
41-
42-
For example, if you want to install/upgrade using Curl as transport and the PSR-7 implementation by Guzzle, you can use:
37+
You can install this bundle using Composer:
4338

4439
```bash
45-
composer require sentry/sentry-symfony:^3.0 php-http/curl-client guzzlehttp/psr7
40+
composer require sentry/sentry-symfony:^3.0
4641
```
4742

48-
Or, if you want to use only Guzzle 6, you can use:
43+
#### Optional: use custom HTTP factory/transport
44+
*Note: this step is optional*
45+
46+
Since SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to have installed two packages that provides
47+
[`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
48+
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).
49+
50+
This bundle depends on `sentry/sdk`, which is a metapackage that already solves this need, requiring our suggested HTTP
51+
packages: the Curl client and Guzzle's message factories.
52+
53+
If instead you want to use a different HTTP client or message factory, you'll need to require manually those additional
54+
packages:
55+
4956
```bash
50-
composer require sentry/sentry-symfony:^3.0 php-http/guzzle6-adapter guzzlehttp/psr7
57+
composer require sentry/sentry-symfony:^3.0 sentry/sentry:^2.0 php-http/guzzle6-adapter guzzlehttp/psr7
5158
```
5259

60+
The `sentry/sentry` package is required directly to override `sentry/sdk`, and the other two packages are up to your choice;
61+
in the current example, we're using both Guzzle's components (client and message factory).
62+
5363
> TODO: Flex recipe
5464
5565
### Step 2: Enable the Bundle
@@ -77,7 +87,7 @@ class AppKernel extends Kernel
7787
// ...
7888
}
7989
```
80-
Note that, unlike before version 3, the bundle will be enabled in all environments.
90+
Note that, unlike before in version 3, the bundle will be enabled in all environments.
8191

8292
### Step 3: Configure the SDK
8393

UPGRADE-3.0.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,28 @@ The 3.0 major release of this bundle has some major changes. This document will
33
during the upgrade path.
44

55
## Sentry SDK 2.0
6-
The major change is in the fact that we now require the underlying `sentry/sentry` package to have version 2.
6+
The major change is in the fact that we now require the `sentry/sdk` metapackage; this, in turn, requires the original
7+
`sentry/sentry` package, but at major version 2.
78
This new version has been completely rewritten: if you use this bundle and you interact directly with the underlying SDK
89
and client, you should read through the [relative upgrade document](https://github.com/getsentry/sentry-php/blob/master/UPGRADE-2.0.md).
910

1011
## HTTPlug
11-
Since SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to manually require two packages that provides
12+
Since SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to have installed two packages that provides
1213
[`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
1314
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).
1415

15-
For example, if you want to install/upgrade using Curl as transport and the PSR-7 implementation by Guzzle, you can use:
16+
The metapackage already solves this need, requiring the Curl client and Guzzle's message factories.
17+
18+
If instead you want to use a different HTTP client or message factory, you'll need to require manually those additional
19+
packages:
1620

1721
```bash
18-
composer require sentry/sentry:2.0.0-beta1 php-http/curl-client guzzlehttp/psr7
22+
composer require sentry/sentry:^2.0 php-http/guzzle6-adapter guzzlehttp/psr7
1923
```
2024

25+
The `sentry/sentry` package is required directly to override `sentry/sdk`, and the other two packages are up to your choice;
26+
in the current example, we're using both Guzzle's components (client and message factory).
27+
2128
## Changes in the services
2229
Due to the SDK changes, and to follow newer Symfony best practices, the services exposed by the bundle are completely
2330
changed:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"require": {
2222
"php": "^7.1",
2323
"jean85/pretty-package-versions": "^1.0",
24-
"sentry/sentry": "^2.0-beta2",
24+
"sentry/sdk": "^2.0",
2525
"symfony/config": "^3.0||^4.0",
2626
"symfony/console": "^3.3||^4.0",
2727
"symfony/dependency-injection": "^3.0||^4.0",

0 commit comments

Comments
 (0)