Skip to content

Commit 0b10231

Browse files
committed
Merge pull request #197 from luxifer/fix-symfony-2-7-deprecation
Fix ConfigCache deprecation with Symfony 2.7
2 parents fbc7c38 + f6303f8 commit 0b10231

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Controller/Controller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public function indexAction(Request $request, $_format)
8282
$serializedRoutes = $this->serializer->serialize($exposedRoutes, 'json');
8383
$cache->write($serializedRoutes, $this->exposedRoutesExtractor->getResources());
8484
} else {
85-
$serializedRoutes = file_get_contents((string) $cache);
85+
$path = method_exists($cache, 'getPath') ? $cache->getPath() : (string) $cache;
86+
$serializedRoutes = file_get_contents($path);
8687
$exposedRoutes = $this->serializer->deserialize(
8788
$serializedRoutes,
8889
'Symfony\Component\Routing\RouteCollection',

0 commit comments

Comments
 (0)