Skip to content

Use SDK metapackage #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2019
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
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Symfony integration for [Sentry](https://getsentry.com/).
>
> A beta version will be tagged as soon as possible, in the meantime you can continue to use the previous versions.
>
> To know more about the progress of this version see [the relative
milestone](https://github.com/getsentry/sentry-symfony/milestone/3)
> To know more about the progress of this version see [the relative milestone](https://github.com/getsentry/sentry-symfony/milestone/3)

## Benefits

Expand All @@ -35,21 +34,32 @@ Use sentry-symfony for:
## Installation

### Step 1: Download the Bundle
You can install this bundle using Composer. Since the Sentry SDK uses HTTPlug to remain transport-agnostic, you need to
manually require two additional packages that provides [`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).

For example, if you want to install/upgrade using Curl as transport and the PSR-7 implementation by Guzzle, you can use:
You can install this bundle using Composer:

```bash
composer require sentry/sentry-symfony:^3.0 php-http/curl-client guzzlehttp/psr7
composer require sentry/sentry-symfony:^3.0
```

Or, if you want to use only Guzzle 6, you can use:
#### Optional: use custom HTTP factory/transport
*Note: this step is optional*

Since SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to have installed two packages that provides
[`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).

This bundle depends on `sentry/sdk`, which is a metapackage that already solves this need, requiring our suggested HTTP
packages: the Curl client and Guzzle's message factories.

If instead you want to use a different HTTP client or message factory, you'll need to require manually those additional
packages:

```bash
composer require sentry/sentry-symfony:^3.0 php-http/guzzle6-adapter guzzlehttp/psr7
composer require sentry/sentry-symfony:^3.0 sentry/sentry:^2.0 php-http/guzzle6-adapter guzzlehttp/psr7
```

The `sentry/sentry` package is required directly to override `sentry/sdk`, and the other two packages are up to your choice;
in the current example, we're using both Guzzle's components (client and message factory).

> TODO: Flex recipe

### Step 2: Enable the Bundle
Expand Down Expand Up @@ -77,7 +87,7 @@ class AppKernel extends Kernel
// ...
}
```
Note that, unlike before version 3, the bundle will be enabled in all environments.
Note that, unlike before in version 3, the bundle will be enabled in all environments.

### Step 3: Configure the SDK

Expand Down
15 changes: 11 additions & 4 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@ The 3.0 major release of this bundle has some major changes. This document will
during the upgrade path.

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

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

For example, if you want to install/upgrade using Curl as transport and the PSR-7 implementation by Guzzle, you can use:
The metapackage already solves this need, requiring the Curl client and Guzzle's message factories.

If instead you want to use a different HTTP client or message factory, you'll need to require manually those additional
packages:

```bash
composer require sentry/sentry:2.0.0-beta1 php-http/curl-client guzzlehttp/psr7
composer require sentry/sentry:^2.0 php-http/guzzle6-adapter guzzlehttp/psr7
```

The `sentry/sentry` package is required directly to override `sentry/sdk`, and the other two packages are up to your choice;
in the current example, we're using both Guzzle's components (client and message factory).

## Changes in the services
Due to the SDK changes, and to follow newer Symfony best practices, the services exposed by the bundle are completely
changed:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": "^7.1",
"jean85/pretty-package-versions": "^1.0",
"sentry/sentry": "^2.0-beta2",
"sentry/sdk": "^2.0",
"symfony/config": "^3.0||^4.0",
"symfony/console": "^3.3||^4.0",
"symfony/dependency-injection": "^3.0||^4.0",
Expand Down