예제 #1
0
 public function resetRouterCache()
 {
     if (!$this->router instanceof Router) {
         return;
     }
     $cachedir = $this->router->getOption('cache_dir');
     $cacheclass = $this->router->getOption('matcher_cache_class');
     $cachedebug = $this->router->getOption('debug');
     // here i have to make sure, that cache not will be right with the old in memory routecollection
     $this->router->setOption('cache_dir', null);
     $cache = new ConfigCache($cachedir . '/' . $cacheclass . '.php', $cachedebug);
     if (file_exists($cache->__toString())) {
         unlink($cache->__toString());
     }
     $cacheclass = $this->router->getOption('generator_cache_class');
     $cache = new ConfigCache($cachedir . '/' . $cacheclass . '.php', $cachedebug);
     if (file_exists($cache->__toString())) {
         unlink($cache->__toString());
     }
 }