-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from gsteel/add-migration-guide
Initial Migration Guide for v3
- Loading branch information
Showing
6 changed files
with
52 additions
and
590 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,49 @@ | ||
# Migration from Version 2 to 3 | ||
|
||
laminas-filter version 3 makes a number of changes that may affect your application. | ||
This document details those changes, and provides suggestions on how to update your application to work with version 3. | ||
|
||
## Removed Filters | ||
|
||
The following filters were deprecated in the 2.0.x series of releases and have now been removed: | ||
|
||
### Encryption and Decryption related filters | ||
|
||
These filters had become outdated. We recommend that you make use of a maintained encryption library and [write your own filters](../writing-filters.md) if you need to encrypt or decrypt content using the `FilterInterface` contract. | ||
|
||
- `Laminas\Filter\File\Decrypt` | ||
- `Laminas\Filter\File\Encrypt` | ||
- `Laminas\Filter\Decrypt` | ||
- `Laminas\Filter\Encrypt` | ||
|
||
### Static Filter | ||
|
||
`Laminas\Filter\StaticFilter` has been removed without replacement. Most filters are "new-able" so similar behaviour can be accomplished with: | ||
|
||
```php | ||
$filtered = (new \Laminas\Filter\HtmlEntities())('Nuts & Bolts'); | ||
``` | ||
|
||
For filters requiring more complex construction, we encourage you to make use of dependency injection and compose the filter itself, or the `FilterPluginManager`, for example: | ||
|
||
```php | ||
$pluginManager = $container->get(\Laminas\Filter\FilterPluginManager::class); | ||
$filter = $pluginManager->get(\Laminas\Filter\HtmlEntities::class); | ||
$filtered = $filter->filter('A String'); | ||
``` | ||
|
||
### Whitelist & Blacklist Filters | ||
|
||
- `Laminas\Filter\Whitelist` has been replaced by [`Laminas\Filter\AllowList`](../standard-filters.md#allowlist) | ||
- `Laminas\Filter\Blacklist` has been replaced by [`Laminas\Filter\DenyList`](../standard-filters.md#denylist) | ||
|
||
## Removed Features | ||
|
||
`Laminas\Filter\Compress` no longer supports the compression formats `Lzf`, `Rar` and `Snappy`. | ||
Support for these formats has been removed so the following classes are no longer available: | ||
|
||
- `Laminas\Filter\Compress\Lzf` | ||
- `Laminas\Filter\Compress\Rar` | ||
- `Laminas\Filter\Compress\Snappy` | ||
|
||
The following compression formats are still available: `Bz2`, `Gz`, `Tar` and `Zip` |
Oops, something went wrong.