Skip to content

Commit

Permalink
Merge pull request #5 from Saeven/feature/laminas-migration
Browse files Browse the repository at this point in the history
Migration to Laminas
  • Loading branch information
Saeven committed Jan 31, 2022
2 parents 755a54b + fc50921 commit df1e592
Show file tree
Hide file tree
Showing 14 changed files with 2,525 additions and 1,601 deletions.
30 changes: 5 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,16 @@ language: php
matrix:
fast_finish: true
include:
- php: 5.6
- php: 7.1
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- php: 5.6
env:
- DEPS=latest
- php: 7
env:
- DEPS=lowest
- php: 7
- php: 7.1
env:
- DEPS=locked
- CHECK_CS=true
- php: 7
env:
- DEPS=latest
- php: hhvm
env:
- DEPS=lowest
- php: hhvm
env:
- DEPS=locked
- php: hhvm
- php: 7.1
env:
- DEPS=latest
allow_failures:
- php: hhvm

env:
global:
Expand All @@ -44,8 +24,8 @@ cache:
- $HOME/.composer/cache

before_install:
- if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then phpenv config-rm xdebug.ini ; fi
- travis_retry composer self-update
- if [[ "$(php --version | grep xdebug -ci)" -ge 1 ]]; then phpenv config-rm xdebug.ini ; fi
- travis_retry composer self-update

install:
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ All notable changes to this project will be documented in this file, in reverse
- **[BC-BREAK]** Removed zendframework monolithic dependency and bumped zend-filter minimum version to 2.5 ([#5](https://github.com/Soflomo/Purifier/pull/5), [#6](https://github.com/Soflomo/Purifier/pull/6))

### Removed
- **[BC-BREAK]** Loading the module via `Zend\Loader` is no longer possible. Composer autoloader is now required.
- **[BC-BREAK]** Loading the module via `Laminas\Loader` is no longer possible. Composer autoloader is now required.


## 0.1.1 - 2013-04-23
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Soflomo\Purifier is the [HTMLPurifier](http://htmlpurifier.org/) integration for Zend Framework 2.

It provides a `Zend\Filter\FilterInterface` implementation so you can use HTMLPurifier within your `Zend\InputFilter` classes.
It provides a `Laminas\Filter\FilterInterface` implementation so you can use HTMLPurifier within your `Laminas\InputFilter` classes.
Furthermore, a view helper is provided to help purifying html on the fly in view scripts.


Expand All @@ -30,7 +30,7 @@ In your input filter configuration, use the `htmlpurifier` as `name` in your fil
An example `Form`:

```php
class MyForm extends Zend\Form\Form implements Zend\InputFilter\InputFilterProviderInterface
class MyForm extends Laminas\Form\Form implements Laminas\InputFilter\InputFilterProviderInterface
{
public function init()
{
Expand Down Expand Up @@ -63,7 +63,7 @@ class MyForm extends Zend\Form\Form implements Zend\InputFilter\InputFilterProvi
or an `InputFilter`:

```php
class MyInputFilter extends Zend\InputFilter\InputFilter
class MyInputFilter extends Laminas\InputFilter\InputFilter
{
public function init()
{
Expand Down Expand Up @@ -147,7 +147,7 @@ Definitions can also be set under the `definitions` key in the `config` array. T
You can also set a different configuration each time you add the filter with a spec using the usual `options` key:

```php
class MyInputFilter extends Zend\InputFilter\InputFilter
class MyInputFilter extends Laminas\InputFilter\InputFilter
{
public function init()
{
Expand All @@ -174,7 +174,7 @@ class MyInputFilter extends Zend\InputFilter\InputFilter

If you instantiate your forms or your input filters manually with the `new` keyword, rather than pulling them from their respective plugin managers (i.e. `FormElementManager` and `InputFilterManager`), the `FilterManager` is not injected automatically into their factories, and these will resort to use a default one.

As such, you get a `ServiceNotFoundException: Zend\Filter\FilterPluginManager::get was unable to fetch or create an instance for htmlpurifier`. This means the filter plugin manager was lazily instantiated, and does not know about the `htmlpurifier` plugin.
As such, you get a `ServiceNotFoundException: Laminas\Filter\FilterPluginManager::get was unable to fetch or create an instance for htmlpurifier`. This means the filter plugin manager was lazily instantiated, and does not know about the `htmlpurifier` plugin.

You can hack your way through this by executing the initializers manually:

Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@
}
},
"require": {
"php": ">=5.6",
"zendframework/zend-filter": "^2.7.1",
"php": ">=7.4",
"laminas/laminas-filter": "^2.13.1",
"ezyang/htmlpurifier": "^4.5"
},
"require-dev": {
"zendframework/zend-servicemanager": "^3.0.1",
"zendframework/zend-view": "^2.8.1",
"laminas/laminas-servicemanager": "^3.7",
"laminas/laminas-view": "^2.14",
"phpunit/phpunit": "^4.8",
"php-vfs/php-vfs": "^1.3",
"fabpot/php-cs-fixer": "^1.11",
"zendframework/zend-mvc": "^3.0.1",
"zendframework/zend-inputfilter": "^2.7.3",
"zendframework/zend-serializer": "^2.8.0",
"zendframework/zend-log": "^2.9.1",
"zendframework/zend-i18n": "^2.7.3",
"zendframework/zend-console": "^2.6.0",
"zendframework/zend-http": "^2.5"
"laminas/laminas-mvc": "^3.0.1",
"laminas/laminas-inputfilter": "^2.7.3",
"laminas/laminas-serializer": "^2.8.0",
"laminas/laminas-log": "^2.9.1",
"laminas/laminas-i18n": "^2.7.3",
"laminas/laminas-console": "^2.6.0",
"laminas/laminas-http": "^2.5"
},
"suggest": {
"zendframework/zend-servicemanager": "For creating the filter with the SM factory",
"zendframework/zend-view": "For using the purifier as view helper",
"zendframework/zend-modulemanager": "To load the filter as a module in a ZF2 application"
"laminas/laminas-servicemanager": "For creating the filter with the SM factory",
"laminas/laminas-view": "For using the purifier as view helper",
"laminas/laminas-modulemanager": "To load the filter as a module in a ZF2 application"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit df1e592

Please sign in to comment.