private function generateExpireCheckCache($expire_check_path) { $root_dir = dirname($this->container->getParameter('kernel.root_dir')); $fs = new \Symfony\Component\Filesystem\Filesystem(); $bundles = array(); foreach ($this->admin_generators as $key => $admin) { if (isset($bundles[$admin->bundle_name])) { continue; } $file = $admin->getFilename(); $file = trim($fs->makePathRelative($file, $root_dir), '/'); $bundles[$admin->bundle_name] = dirname($file) . '/'; continue; if (!isset($dirs[$_dir])) { $dirs[$_dir] = array(); } $_entity_file = basename($file); $dirs[$_dir][$_entity_file] = filemtime($admin->getFilename()); } $dirs = array(); foreach ($bundles as $entity_dir) { $finder = new \Symfony\Component\Finder\Finder(); $finder->name('*.php'); foreach ($finder->in($root_dir . '/' . $entity_dir) as $file) { $dirs[$entity_dir][$file->getRelativePathname()] = filemtime($file->getRealpath()); } } $default_resources = array('app/config/symforce/admin.yml'); foreach ($default_resources as $file) { $dirs[0][$file] = filemtime($root_dir . '/' . $file); } foreach ($this->expire_check_resources as $file) { $_file = trim($fs->makePathRelative($file, $root_dir), '/'); if (!in_array($_file, $dirs[0])) { $dirs[0][$_file] = filemtime($file); } } /** * @todo add yml configure check */ \Dev::write_file($expire_check_path, '<' . '?php return ' . var_export($dirs, 1) . ';'); }