diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php index 782cfd74..521a0b93 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/PurgeFileCommand.php @@ -65,7 +65,7 @@ class PurgeFileCommand extends Command if($fs->exists($directory)) { $finder = new Finder(); - $finder->in($directory)->directories()->exclude("thumb")->exclude("thumbmini"); + $finder->depth('== 0')->in($directory)->directories(); foreach (iterator_to_array($finder) as $file) { $name = $file->getRelativePathname(); @@ -83,6 +83,28 @@ class PurgeFileCommand extends Command } } break; + + case "projecttask": + $entity=$this->em->getRepository("CadolesPortalBundle:Projecttask")->find($id); + if(!$entity) { + $this->writeln($name); + $url=$directory."/".$name; + if($fs->exists($url)) { + $fs->remove($url); + } + } + break; + + case "calendarevent": + $entity=$this->em->getRepository("CadolesPortalBundle:Calendarevent")->find($id); + if(!$entity) { + $this->writeln($name); + $url=$directory."/".$name; + if($fs->exists($url)) { + $fs->remove($url); + } + } + break; } } }