Ejemplo n.º 1
0
 /**
  * 初始化路由配置,路由配置文件为 yml 格式,
  * 放在 app/config/routes 目录下面。
  * 在此目录下可自由组织文件夹和文件名,
  */
 protected function initRoutes()
 {
     $cachePath = $this['cache_path'] . '/config/routes.php';
     $rc = new RoutesCleaner($this, $cachePath, $this['src_path'] . '/*/*/_resources/routes');
     if ($this['debug'] && ($rc->noCache() || $rc->countFilesChanged() || !$rc->getRoutesCache()->isFresh())) {
         $rc->clean();
     }
     $this['routes']->addCollection(\unserialize(file_get_contents($cachePath)));
 }
Ejemplo n.º 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $tc = new Cleaner\TwigCacheCleaner($this->app['cache_path'] . '/twig');
     $tc->clean();
     $output->writeln('Twig caches clean!');
     $rc = new Cleaner\RoutesCleaner($this->app, $this->app['cache_path'] . '/config/routes.php', $this->app['src_path'] . '/*/*/_resources/routes');
     $rc->clean();
     $output->writeln('Routes caches clean!');
 }