/** * @see Console\Command\Command */ protected function execute(InputInterface $input, OutputInterface $output) { $module = $input->getArgument('module'); $path = "{$this->libsDir}/venne/{$module}-module"; if (!file_exists($path)) { $output->writeln("<error>Path '" . $path . "' does not exist.</error>"); return; } \Venne\Utils\File::rmdir($path, TRUE); }
public function cleanSessions() { foreach (Finder::find('*')->in($this->sessionsDir) as $file) { $path = $file->getPathname(); if (is_dir($path)) { File::rmdir($path, TRUE); } else { unlink($path); } } }
/** * @secured(privilege="remove") */ public function handleDelete($key) { $path = $this->moduleHelpers->expandPath($key, 'Resources/layouts'); unlink($path); if (substr($path, -14) === '/@layout.latte') { File::rmdir(dirname($path), TRUE); $this->flashMessage($this->translator->translate('Layout has been removed.'), 'success'); } else { $this->flashMessage($this->translator->translate('Template has been removed.'), 'success'); } if (!$this->isAjax()) { $this->redirect('this', array('key' => NULL)); } $this->invalidateControl('content'); $this['panel']->invalidateControl('content'); $this->payload->url = $this->link('this', array('key' => NULL)); }
/** * @param \Venne\Module\IModule $module */ public function uninstall(IModule $module) { $name = $module->getName(); $configuration = $module->getConfiguration(); // update main config.neon if (count($configuration) > 0) { $orig = $data = $this->loadConfig(); $data = $this->getRecursiveDiff($data, $configuration); // remove extension parameters $configuration = $module->getConfiguration(); if (isset($configuration['extensions'])) { foreach ($configuration['extensions'] as $key => $values) { if (isset($data[$key])) { unset($data[$key]); } } } $this->saveConfig($data); $this->actions[] = function ($self) use($orig) { $self->saveConfig($orig); }; } // remove resources dir $resourcesDir = $this->resourcesDir . "/{$name}Module"; if (file_exists($resourcesDir)) { if (is_link($resourcesDir)) { unlink($resourcesDir); } else { File::rmdir($resourcesDir, TRUE); } } }