protected function execute(InputInterface $input, OutputInterface $output) { $logger = $this->getContainer()->get('BnvWebLogger'); $context = array('source' => 'DeleteJobBackupsCommand'); $backupsDir = Globals::getSnapshotRoot($input->getArgument('client'), $input->getArgument('job')); if (Globals::delTree($backupsDir)) { $logger->info('Directory deleted: ' . $backupsDir, array('source' => 'DeleteJobBackupsCommand')); return 0; } else { $logger->err('Error deleting directory: ' . $backupsDir, array('source' => 'DeleteJobBackupsCommand')); return 1; } }
/** * @ORM\PostRemove() */ public function removeUpload() { foreach ($this->filesToRemove as $file) { if (file_exists($file)) { if (!Globals::delTree($file)) { throw new RuntimeException("Error removing file " . $file); } } } }