コード例 #1
0
ファイル: CreateCommand.php プロジェクト: svobodni/web
 /**
  * @see Console\Command\Command
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $module = $input->getArgument('module');
     $modules = $this->moduleManager->getModules();
     $path = "{$this->modulesDir}/{$module}-module";
     if (isset($modules[$module])) {
         $output->writeln("<error>Module '{$module}' already exists.</error>");
         return;
     }
     if (file_exists($path)) {
         $output->writeln("<error>Path '" . $path . "' exists.</error>");
         return;
     }
     if (!is_writable(dirname($path))) {
         $output->writeln("<error>Path '" . dirname($path) . "' is not writable.</error>");
         return;
     }
     umask(00);
     mkdir($path, 0777, TRUE);
     file_put_contents($path . '/Module.php', $this->getModuleFile($module));
     file_put_contents($path . '/composer.json', $this->getComposerFile($module));
     file_put_contents($path . '/readme.md', $this->getReadmeFile($module));
     mkdir($path . '/Resources/config', 0777, TRUE);
     mkdir($path . '/Resources/public', 0777, TRUE);
     mkdir($path . '/Resources/translations', 0777, TRUE);
     mkdir($path . '/Resources/layouts', 0777, TRUE);
     mkdir($path . '/' . ucfirst($module) . 'Module', 0777, TRUE);
 }
コード例 #2
0
ファイル: WebsiteFormFactory.php プロジェクト: svobodni/web
 /**
  * @return array
  */
 protected function getModules()
 {
     $ret = array();
     foreach ($this->moduleManager->getModules() as $name => $module) {
         $ret[$name] = '@' . $name . 'Module';
     }
     return $ret;
 }
コード例 #3
0
ファイル: ModulePresenter.php プロジェクト: svobodni/web
 /**
  * @secured(privilege="show")
  */
 public function actionDefault()
 {
     $this->template->modules = $this->moduleManager->getModules();
     $this->template->hiddenModules = $this->hiddenModules;
 }