-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC Add information about deprecations
- Loading branch information
1 parent
3ffd586
commit e646a9b
Showing
3 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Deprecations | ||
--- | ||
|
||
# Upgrade a project to CMS 5 | ||
|
||
## Updating your codebase to use Silverstripe CMS 5 API | ||
|
||
You'll need to go through your codebase to remove references to deprecated APIs and update your project logic. | ||
|
||
Silverstripe CMS 5 introduces many API changes. They include a deprecation message that will either tell you: | ||
- to simply use a different yet equivalent API instead, or | ||
- the API in question has no replacement. This is usually for API that was mostly irrelevant. | ||
|
||
To see deprecation warnings in your project and in your project's CI, add `SS_DEPRECATION_ENABLED=true` to your project's `.env` file. | ||
|
||
Alternatively, add the following line to you project's `app/_config.php`. | ||
```php | ||
Deprecation::enable() | ||
``` | ||
|
||
Deprecation notices will only ever show if your `SS_ENVIRONMENT_TYPE` is set to `dev`. | ||
|
||
Your project will now start emitting deprecation warnings on the frontend if you are calling deprecated code, along with the different API you should now use instead, if a replacement exists. | ||
|
||
Not all API that was deprecated in CMS 4 that has an equivalent API has that API in CMS 4; some of the API is only available from CMS 5. 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. You'll need to upgrade to CMS 5 before you can access the `symfony/mailer` API. | ||
|
||
Your project will emit deprecation notices for these, although there may be nothing you can do to stop calling that code until you upgrade to CMS 5. In this case you should use the deprecation notice to construct a list of what you may need to change after upgrading. | ||
|
||
Once you have resolved all of the deprecation notices you can, it is recommended to turn off deprecation notices again. |