public function createModule($fullyQualifiedName, Request $request) { Logging::info("Modul {$fullyQualifiedName} wird angelegt"); $naming = new ModuleNaming(); $module = new Module(); $module->namespace = $fullyQualifiedName; $module->qualifiedName = $naming->getQualifiedNameFromNamespace($module->namespace); $module->name = $naming->getSimpleNameFromNamespace($module->namespace); $module->path = str_replace('\\', '/', $fullyQualifiedName); $path = $module->getPath(); $controller = $path . '/' . ucwords($module->name) . 'Controller.php'; $installer = $path . '/' . ucwords($module->name) . 'Installer.php'; // Verzeichnisse anlegen mkdir($path, 0777, true); mkdir($path . '/Views'); mkdir($path . '/Model'); $search = array('%MODULE%', '%AUTHOR%', '%VERSION%', '%DESCRIPTION%', '%NAMESPACE%'); $replace = array(ucwords($module->name), $request->author, $request->version, $request->description, $module->namespace); // Variablen ersetzen und Dateien speichern $this->variablenEinsetzen(__DIR__ . '/Prototype/Controller.template', $controller, $search, $replace); $this->variablenEinsetzen(__DIR__ . '/Prototype/Module.xml', $path . '/Module.xml', $search, $replace); $this->variablenEinsetzen(__DIR__ . '/Prototype/Installer.template', $installer, $search, $replace); return $module; }