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

Closed
wants to merge 2 commits into
from

Projects

None yet

4 participants

@weierophinney
Zend Framework 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.

weierophinney added some commits May 3, 2013
@weierophinney weierophinney Rename service to "MvcTranslator"
- Removes conflict with ZendSkeletonApplication, which defines a "translator"
  service already.
8ac24fb
@weierophinney weierophinney Update service name when mocking
- s/translator/MvcTranslator/
1fefe0a
@weierophinney weierophinney added a commit to weierophinney/ZendSkeletonApplication that referenced this pull request May 3, 2013
@weierophinney weierophinney Change "translator" service to an alias
- Aliasing to an "MvcTranslator" service, as defined in
  zendframework/zendframework#4410
2ce1cf0
@prolic

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

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

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

@weierophinney
Zend Framework member

@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

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

@padraic
Zend Framework member

Again, looks fine here.

@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney Merge branch 'hotfix/validator-service-compat'
Close #4410
835d13f
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney Merge branch 'hotfix/validator-service-compat' into develop
Forward port #4410
a8d33c1
@danizord

@weierophinney Why do not you updated the HelperPluginManager too?

Zend Framework member

@danizord Because apparently I missed that. That said, in most applications, it should not be an issue as translator is an alias to MvcTranslator. I'll provide an update, however.

Zend Framework member

@danizord Please see #4870

@Schneider95220 Schneider95220 pushed a commit to Schneider95220/BlogMurVesperia that referenced this pull request Oct 2, 2014
@weierophinney weierophinney Change "translator" service to an alias
- Aliasing to an "MvcTranslator" service, as defined in
  zendframework/zendframework#4410
a5dd31e
@Schneider95220 Schneider95220 pushed a commit to Schneider95220/BlogMurVesperia that referenced this pull request Oct 2, 2014
@weierophinney weierophinney Change "translator" service to an alias
- Aliasing to an "MvcTranslator" service, as defined in
  zendframework/zendframework#4410
c33c558
@N3XT0R N3XT0R pushed a commit to N3XT0R/TS3UI that referenced this pull request Feb 24, 2015
@weierophinney weierophinney Change "translator" service to an alias
- Aliasing to an "MvcTranslator" service, as defined in
  zendframework/zendframework#4410
df346cf
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/validator-service-compat' d05ac01
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/validator-service-compat' into develop a4f47c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment