Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / routing / Router.php
index 6ac4205a598fcaf46611fb48353c90a7ebad9717..ed56332ecd5f5349191a7b0ba2b78eb366b6a150 100644 (file)
@@ -84,8 +84,6 @@ class Router implements RouterInterface, RequestMatcherInterface
     private $expressionLanguageProviders = array();
 
     /**
-     * Constructor.
-     *
      * @param LoaderInterface $loader   A LoaderInterface instance
      * @param mixed           $resource The main resource to load
      * @param array           $options  An array of options
@@ -228,8 +226,6 @@ class Router implements RouterInterface, RequestMatcherInterface
 
     /**
      * Sets the ConfigCache factory to use.
-     *
-     * @param ConfigCacheFactoryInterface $configCacheFactory The factory to use
      */
     public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory)
     {
@@ -306,7 +302,9 @@ class Router implements RouterInterface, RequestMatcherInterface
             }
         );
 
-        require_once $cache->getPath();
+        if (!class_exists($this->options['matcher_cache_class'], false)) {
+            require_once $cache->getPath();
+        }
 
         return $this->matcher = new $this->options['matcher_cache_class']($this->context);
     }
@@ -338,7 +336,9 @@ class Router implements RouterInterface, RequestMatcherInterface
                 }
             );
 
-            require_once $cache->getPath();
+            if (!class_exists($this->options['generator_cache_class'], false)) {
+                require_once $cache->getPath();
+            }
 
             $this->generator = new $this->options['generator_cache_class']($this->context, $this->logger);
         }