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

Fix conflict between translator service in ZF2 and skeleton app #4410

Conversation

weierophinney
Copy link
Member

This fixes a conflict raised by #4391 and reported in zendframework/ZendSkeletonApplication#184 -- basically, the skeleton application was defining a "translator" factory already, which meant that with the changes on ZF2, we were creating a conflict for anybody upgrading their existing app to the latest master.

What this PR does is create a new "MvcTranslator" service, using the MVC's translator factory. This ensures the original translator factory continues to work, while allowing validators to work in a turn-key fashion.

- Removes conflict with ZendSkeletonApplication, which defines a "translator"
  service already.
- s/translator/MvcTranslator/
weierophinney added a commit to weierophinney/ZendSkeletonApplication that referenced this pull request May 3, 2013
- Aliasing to an "MvcTranslator" service, as defined in
  zendframework/zendframework#4410
@prolic
Copy link
Contributor

prolic commented May 5, 2013

Well, I don't like the "Mvc"-prefix, because we don't have these on any other service defined in zf2.
Unfortunatly, I don't see another solution, too.

So, good to merge :-(

@danizord
Copy link
Contributor

danizord commented May 5, 2013

I think the problem is in SkeletonApplication, not here.
It is a good practice to register our application services named by FQCN or prefixed by vendor name, it avoids conflicts with these services defined within the Framework.

@prolic
Copy link
Contributor

prolic commented May 5, 2013

@danizord agree, but....
The Skeleton Application is also released, BC breaks in another repo doesn't solve this point.

@weierophinney
Copy link
Member Author

@danizord as @prolic notes, if we don't make this change, anybody who used the skeleton app prior to 2.2 and who then updates to 2.2 will have a broken application. This is really the best way to go.

Regarding why I'm using the name "MvcTranslator" -- it's because it's an MVC-specific factory that uses a version of the Translator that implements interfaces from multiple components. You can see a similar implementation in the aura.framework package. We could introduce a "framework" or "integration" component, but, for all intents and purposes, our MVC component is already that component.

@danizord
Copy link
Contributor

danizord commented May 6, 2013

@weierophinney Got it. The "Zend\Integration" does not sound like a bad idea for the next release.

@padraic
Copy link
Member

padraic commented May 6, 2013

Again, looks fine here.

weierophinney added a commit that referenced this pull request May 6, 2013
N3XT0R pushed a commit to N3XT0R/TS3UI that referenced this pull request Feb 24, 2015
- Aliasing to an "MvcTranslator" service, as defined in
  zendframework/zendframework#4410
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants