Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Avoid needless Zend\Filter dependency #25

Merged

Conversation

danizord
Copy link
Contributor

As far I know the filter chain of PhpRenderer is not used by Zend\Mvc default rendering strategy (@weierophinney can you confirm?) and it seems like most users of PhpRenderer does not use the filter chain feature at all.

So I added this check to avoid Zend\Filter dependency when the filter chain is not explicity defined by setFilterChain() nor lazy initialized by getFilterChain().

Maybe that fixes #3, #12 and #24.

@codeliner
Copy link

👍

@harikt
Copy link

harikt commented Dec 23, 2015

Hi @danizord ,

Can I understand what the filter chain exactly is doing ?

My feelings are in this direction for I fear magic behind this. I am sure people will come blame if they expect something from the Filter .

  1. Specifically mention about the dependency on composer installation as @weierophinney him self has mentioned (Zend filter is a hard dependency #24 (comment)) .
composer require zendframework/zend-view zendframework/zend-filter

EDIT : Though I don't like it very much, but still this helps people I guess, and can also make a note about can extend the Filter with some interface ?

  1. These ( https://github.com/zendframework/zend-view/pull/24/files#diff-b5d0ee8c97c7abd7e3fa29b9a27d1780L46 ) sort of suggest is just useless for it don't say if you are using phprenderer you need this component also. What does just suggest with component name says?

So I am not in favour of this PR for I don't know the drawbacks if the filter is not calling.

@danizord
Copy link
Contributor Author

So I am not in favour of this PR for I don't know the drawbacks if the filter is not calling.

No drawbacks. When an instance of FilterChain is present the behavior keeps the same. This PR only changes the behavior when there is no FilterChain defined.

Previously it was creating an empty FilterChain that actually does nothing, now it is just skipping.

@harikt
Copy link

harikt commented Dec 23, 2015

ok cool. Thanks for the information @danizord .

So what is the real purpose of keeping the unused FilterChain object then?

@danizord
Copy link
Contributor Author

So what is the real purpose of keeping the unused FilterChain object then?

Mainly for backwards compatibility. But even if it is not widely used, it is still useful if you want to filter output

@danizord
Copy link
Contributor Author

Pinging @weierophinney for review :)

@weierophinney weierophinney added this to the 2.5.3 milestone Jan 19, 2016
@weierophinney weierophinney self-assigned this Jan 19, 2016
@weierophinney weierophinney merged commit c454b3b into zendframework:master Jan 19, 2016
weierophinney added a commit that referenced this pull request Jan 19, 2016
weierophinney added a commit that referenced this pull request Jan 19, 2016
weierophinney added a commit that referenced this pull request Jan 19, 2016
Close #25
Fixes #3
Fixes #12
Fixes #24
weierophinney added a commit that referenced this pull request Jan 19, 2016
@danizord danizord deleted the hotfix/avoid-filter-dependency branch January 19, 2016 22:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zend view does not work standalone
4 participants