@@ -77,33 +77,6 @@ All notable changes to this project will be documented in this file, in reverse
77
77
78
78
- Integration with ` Zend\Di ` has been removed. It may be re-integrated later.
79
79
80
- - The ` invokables ` configuration key no longer exists. It has been replaced by a
81
- built-in factory.
82
-
83
- In versions 2.x:
84
-
85
- ``` php
86
- return [
87
- 'service_manager' => [
88
- 'invokables' => [
89
- MyClass::class => MyClass:class,
90
- ],
91
- ],
92
- ];
93
- ```
94
-
95
- In ZF 3.x:
96
-
97
- ``` php
98
- return [
99
- 'service_manager' => [
100
- 'factories' => [
101
- MyClass::class => 'Zend\ServiceManager\Factory\InvokableFactory',
102
- ],
103
- ],
104
- ];
105
- ```
106
-
107
80
- ` MutableCreationOptionsInterface ` has been removed, as options can now be
108
81
passed directly through factories.
109
82
@@ -138,12 +111,24 @@ changes, outlined in this section.
138
111
]);
139
112
```
140
113
114
+ ` Config ` and ` ConfigInterface ` still exist, however, but primarily for the
115
+ purposes of codifying and aggregating configuration to use.
116
+
141
117
- The ServiceManager is now immutable. Once configured, it cannot be altered.
142
118
You need to create a new service manager if you need to change the
143
119
configuration. This ensures safer and more aggressive caching. A new method,
144
120
` withConfig() ` , allows you to create a new instance that merges the provided
145
121
configuration.
146
122
123
+ - ` ConfigInterface ` has two important changes:
124
+ - ` configureServiceManager() ` now ** must** return a service manager instance.
125
+ Since the ServiceManager is now immutable, and the various methods for
126
+ injecting services are gone, the expectation is that this method will pass
127
+ configuration to ` ServiceManager::withConfig() ` and return the new instance.
128
+ - A new method, ` toArray() ` , was added, to allow pulling the configuration in
129
+ order to pass to a ServiceManager or plugin manager's constructor or
130
+ ` withConfig() ` method.
131
+
147
132
- Interfaces for ` FactoryInterface ` , ` DelegatorFactoryInterface ` and
148
133
` AbstractFactoryInterface ` have changed. All are now directly invokable. This
149
134
allows a number of performance optimization internally.
@@ -227,6 +212,9 @@ changes, outlined in this section.
227
212
- ` PluginManager ` now enforces the need for the main service locator in its
228
213
constructor. In v2.x, people often forgot to set the parent locator, which led
229
214
to bugs in factories trying to fetch dependencies from the parent locator.
215
+ Additionally, plugin managers now pull dependencies from the parent locator by
216
+ default; if you need to pull a peer plugin, your factories will now need to
217
+ pull the corresponding plugin manager first.
230
218
231
219
- It's so fast now that your app will fly!
232
220
0 commit comments