Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

BC Break in Controller Loader, controllers no more present in controller loader. #3576

Closed
Freeaqingme opened this Issue · 8 comments

3 participants

@Freeaqingme
Collaborator

Hi,

I have the following code:

        $controllerLoader = $this->sm->get('controllerloader');
        $controllers = $controllerLoader->getServiceLocator()->getCanonicalNames();

Here the sm property represents the Service Manager. However, some entries (my controllers) that are present in 2.0.6, are no more so in develop.

Diff of the $controllers array:

-array(92) {
+array(102) {
   ["SharedEventManager"]=>
   string(18) "sharedeventmanager"
   ["EventManager"]=>
@@ -46,14 +46,30 @@ array(92) {
   string(13) "consolerouter"
   ["DependencyInjector"]=>
   string(18) "dependencyinjector"
+  ["DiAbstractServiceFactory"]=>
+  string(24) "diabstractservicefactory"
+  ["DiServiceInitializer"]=>
+  string(20) "diserviceinitializer"
+  ["DiStrictAbstractServiceFactory"]=>
+  string(30) "districtabstractservicefactory"
+  ["FilterManager"]=>
+  string(13) "filtermanager"
+  ["FormElementManager"]=>
+  string(18) "formelementmanager"
   ["HttpRouter"]=>
   string(10) "httprouter"
+  ["PaginatorPluginManager"]=>
+  string(22) "paginatorpluginmanager"
   ["Request"]=>
   string(7) "request"
   ["Response"]=>
   string(8) "response"
   ["Router"]=>
   string(6) "router"
+  ["RoutePluginManager"]=>
+  string(18) "routepluginmanager"
+  ["ValidatorManager"]=>
+  string(16) "validatormanager"
   ["ViewHelperManager"]=>
   string(17) "viewhelpermanager"
   ["ViewFeedRenderer"]=>
@@ -78,6 +94,8 @@ array(92) {
   string(16) "dispatchlistener"
   ["RouteListener"]=>
   string(13) "routelistener"
+  ["SendResponseListener"]=>
+  string(20) "sendresponselistener"
   ["Configuration"]=>
   string(13) "configuration"
   ["Console"]=>
@@ -100,18 +118,18 @@ array(92) {
   string(16) "controllerloader"
   ["config"]=>
   string(6) "config"
-  ["Application\Controller\Index"]=>
-  string(26) "applicationcontrollerindex"
-  ["Application\Controller\Api"]=>
-  string(24) "applicationcontrollerapi"
-  ["Application\Controller\Api\Website"]=>
-  string(31) "applicationcontrollerapiwebsite"
-  ["Application\Controller\Api\Website\User"]=>
-  string(35) "applicationcontrollerapiwebsiteuser"
   ["controllerpluginmanager"]=>
   string(23) "controllerpluginmanager"
   ["viewhelpermanager"]=>
   string(17) "viewhelpermanager"
+  ["validatormanager"]=>
+  string(16) "validatormanager"
+  ["filtermanager"]=>
+  string(13) "filtermanager"
+  ["formelementmanager"]=>
+  string(18) "formelementmanager"
+  ["routepluginmanager"]=>
+  string(18) "routepluginmanager"
   ["application"]=>
   string(11) "application"
   ["request"]=>
@@ -124,6 +142,8 @@ array(92) {
   string(16) "dispatchlistener"
   ["viewmanager"]=>
   string(11) "viewmanager"
+  ["sendresponselistener"]=>
+  string(20) "sendresponselistener"
   ["router"]=>
   string(6) "router"
   ["RouteNotFoundStrategy"]=>
@@ -185,10 +205,5 @@ array(92) {
   ["zendservicemanagerservicelocatorinterface"]=>
   string(41) "zendservicemanagerservicelocatorinterface"
 }
@weierophinney
@Ocramius
Collaborator

@weierophinney still should be in there. We only removed the initializer, not the abstract factory.

@weierophinney
@Freeaqingme
Collaborator

@weierophinney I got a pointer from Waly on github to remove the 'getServiceLocator()' call. Removing that, gave me the following array:

array(6) {
  ["Application\Controller\Index"]=>
  string(26) "applicationcontrollerindex"
  ["Application\Controller\Api"]=>
  string(24) "applicationcontrollerapi"
  ["Application\Controller\Api\Website"]=>
  string(31) "applicationcontrollerapiwebsite"
  ["Application\Controller\Api\Website\User"]=>
  string(35) "applicationcontrollerapiwebsiteuser"
  ["applicationcontrollerapi"]=>
  string(24) "applicationcontrollerapi"
  ["applicationcontrollerapiwebsite"]=>
  string(31) "applicationcontrollerapiwebsite"
}

Using that array, my code worked again (on 2.1). Right now, I don't have any code that allows you to reproduce this. I could see if I can set up something with the skeleton app though.

Edit: Switching back to 2.0, without the getServiceLocator() call, it works as well. Nevertheless, we still have some bc break going on.

@Freeaqingme
Collaborator

Git bisect rocks...

$ git bisect bad
8fcc2b13ee7fa564b821913abc698d8c5a15ac97 is the first bad commit
commit 8fcc2b13ee7fa564b821913abc698d8c5a15ac97
Author: Deserved <vasilij.syc@gmail.com>
Date:   Sun Jan 13 23:30:20 2013 +0000

    Issue ZF-3347: Allow Parent ServiceManager create service with the same name as in  child ServiceManager

:040000 040000 d459e07b3911fb221889cd61e36157823db91f24 28398fca95889081a48a158e29651e9bcc408b01 M  library
:040000 040000 2b4fa2ef6610d607820b652af4047510a8f0d33d 2606cb7cb023dbcebcd45b33cc7fa82a198a5057 M  tests
@weierophinney weierophinney referenced this issue from a commit
@weierophinney weierophinney Revert "Merge branch 'ZF-3347' of git://github.com/Deserved/zf2 into …
…hotfix/3424"

This reverts commit b9d1977, reversing
changes made to 054f7a0.

Reverts #3424 due to BC breaks reported in #3576

Conflicts:
	tests/ZendTest/ServiceManager/ServiceManagerTest.php
2a2cfcb
@weierophinney weierophinney referenced this issue from a commit
@weierophinney weierophinney Revert "Merge branch 'hotfix/3424'"
Reverts #3424 due to BC issue reported in #3576

This reverts commit c8c6375, reversing
changes made to 054f7a0.
c562e2c
@weierophinney

@Freeaqingme Can you please test again? I've reverted the PR that introduced the issue.

@weierophinney

Cannot recreate the issue now locally.

@Freeaqingme
Collaborator

@weierophinney Fix confirmed!

@ghost Unknown referenced this issue from a commit
@weierophinney weierophinney Revert "Merge branch 'ZF-3347' of git://github.com/Deserved/zf2 into …
…hotfix/3424"

This reverts commit b9d1977, reversing
changes made to 054f7a0.

Reverts #3424 due to BC breaks reported in #3576

Conflicts:
	tests/ZendTest/ServiceManager/ServiceManagerTest.php
a33b114
@ghost Unknown referenced this issue from a commit
@weierophinney weierophinney Revert "Merge branch 'hotfix/3424'"
Reverts #3424 due to BC issue reported in #3576

This reverts commit c8c6375, reversing
changes made to 054f7a0.
5e4b3f0
@weierophinney weierophinney referenced this issue from a commit in zendframework/zend-servicemanager
@weierophinney weierophinney Revert "Merge branch 'ZF-3347' of git://github.com/Deserved/zf2 into …
…hotfix/3424"

This reverts commit b9d19770186be6b50e9908c94d495db42034f6df, reversing
changes made to 054f7a0f95bb919cce95faa53ced0a525017602f.

Reverts zendframework/zf2#3424 due to BC breaks reported in zendframework/zf2#3576

Conflicts:
	tests/ZendTest/ServiceManager/ServiceManagerTest.php
5b5a4de
@weierophinney weierophinney referenced this issue from a commit in zendframework/zend-servicemanager
@weierophinney weierophinney Revert "Merge branch 'hotfix/3424'"
Reverts zendframework/zf2#3424 due to BC issue reported in zendframework/zf2#3576

This reverts commit c8c637523fe1a5705ba01684386a8ef63e675464, reversing
changes made to 054f7a0f95bb919cce95faa53ced0a525017602f.
30d8776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.