Skip to content

Commit d6a738f

Browse files
authored
Improve the installation instructions of the README (#452)
1 parent 07007cc commit d6a738f

File tree

1 file changed

+19
-26
lines changed

1 file changed

+19
-26
lines changed

README.md

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,28 @@ Use `sentry-symfony` for:
2222
- app path
2323
- excluded paths (cache and vendor)
2424

25-
## Installation with Symfony Flex (Symfony 4 or newer):
26-
If you're using the [Symfony Flex](https://symfony.com/doc/current/setup/flex.html) Composer plugin, you can install this bundle in a single, easy step:
25+
## Installation
26+
27+
To install the SDK you will need to be using [Composer]([https://getcomposer.org/)
28+
in your project. To install it please see the [docs](https://getcomposer.org/download/).
29+
2730
```bash
2831
composer require sentry/sentry-symfony
2932
```
30-
This could show a message similar to this:
31-
```
32-
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
33-
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/sentry/sentry-symfony/3.0
3433

35-
Do you want to execute this recipe?
36-
```
37-
Press `y` and return to allow the installation.
34+
If you're using the [Symfony Flex](https://symfony.com/doc/current/setup/flex.html) Composer plugin, it could show a message similar to this:
3835

39-
## Installation without Symfony Flex:
40-
### Step 1: Download the Bundle
41-
You can install this bundle using Composer:
36+
```
37+
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
38+
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/sentry/sentry-symfony/3.0
4239
43-
```bash
44-
composer require sentry/sentry-symfony
40+
Do you want to execute this recipe?
4541
```
4642

43+
Just type `y`, press return, and the procedure will continue.
44+
4745
**Warning:** due to a bug in all versions lower than `6.0` of the [`SensioFrameworkExtra`](https://github.com/sensiolabs/SensioFrameworkExtraBundle) bundle,
48-
if you have it installed you will likely get an error during the execution of the command above in regards to the missing `Nyholm\Psr7\Factory\Psr17Factory`
46+
if you have it installed you will likely get an error during the execution of the commands above in regards to the missing `Nyholm\Psr7\Factory\Psr17Factory`
4947
class. To workaround the issue, if you are not using the PSR-7 bridge, please change the configuration of that bundle as follows:
5048

5149
```yaml
@@ -58,29 +56,24 @@ For more details about the issue see https://github.com/sensiolabs/SensioFramewo
5856
5957
### Step 2: Enable the Bundle
6058
61-
Then, enable the bundle by adding it to the list of registered bundles
62-
in the `app/AppKernel.php` file of your project:
59+
If you installed the package using the Flex recipe, the bundle will be automatically enabled. Otherwise, enable it by adding it to the list
60+
of registered bundles in the `Kernel.php` file of your project:
6361

6462
```php
65-
<?php
66-
// app/AppKernel.php
67-
68-
// ...
69-
class AppKernel extends Kernel
63+
class AppKernel extends \Symfony\Component\HttpKernel\Kernel
7064
{
71-
public function registerBundles()
65+
public function registerBundles(): array
7266
{
73-
$bundles = [
67+
return [
7468
// ...
7569
new \Sentry\SentryBundle\SentryBundle(),
7670
];
77-
78-
// ...
7971
}
8072
8173
// ...
8274
}
8375
```
76+
8477
Note that, unlike before in version 3, the bundle will be enabled in all environments; event reporting, instead, is enabled
8578
only when providing a DSN (see the next step).
8679

0 commit comments

Comments
 (0)