setDescription('Uninstall Phraseanet'); } /** * {@inheritdoc} */ protected function doExecute(InputInterface $input, OutputInterface $output) { $root = $this->container['root.path']; foreach ([ $root.'/config/configuration.yml', $root.'/config/services.yml', $root.'/config/connexions.yml', $root.'/config/config.yml', $root.'/config/config.inc', $root.'/config/connexion.inc', $root.'/config/_GV.php', $root.'/config/_GV.php.old', $root.'/config/configuration-compiled.php', ] as $file) { if ($this->container['filesystem']->exists($file)) { unlink($file); } } foreach ([ $this->container['tmp.download.path'], $this->container['tmp.lazaret.path'], $this->container['tmp.caption.path'], $this->container['tmp.path'].'/sessions', $this->container['tmp.path'].'/locks', ] as $resource) { if (is_dir($resource)) { $finder = new Finder(); foreach ($finder->files()->in($resource) as $file) { $this->container['filesystem']->remove($file); } } elseif (is_file($resource)) { $this->container['filesystem']->remove($resource); } } $path = $this->container['cache.path']; foreach ([ $path.'/cache_registry.php', $path.'/cache_registry.yml', $path.'/serializer', $path.'/doctrine', $path.'/twig', $path.'/translations', $path.'/minify', $path.'/profiler', ] as $resource) { if (is_dir($resource)) { $finder = new Finder(); foreach ($finder->files()->in($resource) as $file) { $this->container['filesystem']->remove($file); } } elseif (is_file($resource)) { $this->container['filesystem']->remove($resource); } } return 0; } }