public function generate($moduleName) { if ($this->moduleFileExists($moduleName)) { return; } $values = array('%module_name%' => $moduleName, '%code_pool%' => $this->codePool); if (!$this->fileSystem->pathExists($this->path)) { $this->fileSystem->makeDirectory($this->path); } $this->fileSystem->putFileContents($this->getFilePath($moduleName), strtr(file_get_contents(__DIR__ . '/templates/module.template'), $values)); }
/** * @param string $filepath */ private function createDirectoryIfItDoesExist($filepath) { $path = dirname($filepath); if (!$this->filesystem->isDirectory($path)) { $this->filesystem->makeDirectory($path); } }
/** * @param string $xml */ private function writeConfigFile($xml) { if (!$this->filesystem->isDirectory($this->directory)) { $this->filesystem->makeDirectory($this->directory); } $this->filesystem->putFileContents($this->getFilePath(), $xml); }