@@ -79,6 +79,11 @@ class ServiceMetadata
79
79
*/
80
80
private $ serializer ;
81
81
82
+ /**
83
+ * @var string
84
+ */
85
+ private $ routesConfigCacheId ;
86
+
82
87
/**
83
88
* Initialize dependencies.
84
89
*
@@ -100,6 +105,7 @@ public function __construct(
100
105
$ this ->classReflector = $ classReflector ;
101
106
$ this ->typeProcessor = $ typeProcessor ;
102
107
$ this ->serializer = $ serializer ?: ObjectManager::getInstance ()->get (SerializerInterface::class);
108
+ $ this ->routesConfigCacheId = self ::ROUTES_CONFIG_CACHE_ID ;
103
109
}
104
110
105
111
/**
@@ -267,7 +273,7 @@ public function getRouteMetadata($serviceName)
267
273
public function getRoutesConfig ()
268
274
{
269
275
if (null === $ this ->routes ) {
270
- $ routesConfig = $ this ->cache ->load (self :: ROUTES_CONFIG_CACHE_ID );
276
+ $ routesConfig = $ this ->cache ->load ($ this -> routesConfigCacheId );
271
277
$ typesData = $ this ->cache ->load (self ::REFLECTED_TYPES_CACHE_ID );
272
278
if ($ routesConfig && is_string ($ routesConfig ) && $ typesData && is_string ($ typesData )) {
273
279
$ this ->routes = $ this ->serializer ->unserialize ($ routesConfig );
@@ -276,7 +282,7 @@ public function getRoutesConfig()
276
282
$ this ->routes = $ this ->initRoutesMetadata ();
277
283
$ this ->cache ->save (
278
284
$ this ->serializer ->serialize ($ this ->routes ),
279
- self :: ROUTES_CONFIG_CACHE_ID
285
+ $ this -> routesConfigCacheId
280
286
);
281
287
$ this ->cache ->save (
282
288
$ this ->serializer ->serialize ($ this ->typeProcessor ->getTypesData ()),
@@ -287,6 +293,17 @@ public function getRoutesConfig()
287
293
return $ this ->routes ;
288
294
}
289
295
296
+ /**
297
+ * Set Routes Config Cache ID
298
+ *
299
+ * @param string $routesConfigCacheId
300
+ */
301
+ public function setRoutesConfigCacheId ($ routesConfigCacheId ){
302
+
303
+ $ this ->routesConfigCacheId = $ routesConfigCacheId ;
304
+
305
+ }
306
+
290
307
/**
291
308
* Collect the list of services with routes and request types for use in REST.
292
309
*
0 commit comments