Skip to content

Commit

Permalink
DOC Update deprecation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 16, 2024
1 parent c6afec4 commit 94bb4b3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions en/06_Upgrading/07_Deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ Deprecation::enable();
Once you have resolved all of the deprecation warnings you can, it is recommended to turn off deprecation warnings again.

Not all API that gets deprecated will have an equivalent replacement API in that same major version; some of the API is only available from the next major release. A good example of this is the upgrade for what powers the `SilverStripe\Control\Email\Email` class from `swiftmailer` in CMS 4 to `symfony/mailer` in CMS 5. In these cases, you'll need to upgrade to the new major version before you can access the replacement API.
Not all API that gets deprecated will have an equivalent replacement API in that same major version; some of the API is only available from the next major release. A good example of this is the upgrade for what powered the `SilverStripe\Control\Email\Email` class from `swiftmailer` in CMS 4 to `symfony/mailer` in CMS 5. In these cases, you'll need to upgrade to the new major version before you can access the replacement API.

Some code that has been deprecated with no immediate replacement will not emit deprecation notices by default. If you wish to also see notices for deprecated code with no immediate replacement, add the following line to you project's `app/_config.php` file. Note that this will also emit deprecation notices for usages of the deprecated code inside core modules.
Some code that has been deprecated with no immediate replacement will not emit deprecation notices by default. If you wish to also see notices for deprecated code with no immediate replacement, add the following line to you project's `app/_config.php` file:

```php
Deprecation::enable(true);
```

By default, deprecation warnings will not be emitted if the deprecated code was called by core code, for instance any code contained in the `vendor/silverstripe` directory. This is because these warnings are simply not relevant for most developers. If you wish to see deprecation warnings for code called by core code, add the following line to your project's `app/_config.php` file:

```php
Deprecation::setShowCalledFromSupportedCodeNotices(true);
```

## How to view deprecation warnings

By default, deprecation warnings will be emitted to the error logger, and will be output at the end of CLI responses. They will not be included in HTTP responses by default.
Expand Down

0 comments on commit 94bb4b3

Please sign in to comment.