pluginDirectory = $pluginDirectory; } public function write($manifests) { $this ->doWrite('autoload.php', $this->createLoader($manifests)) ->doWrite('services.php', $this->createServices($manifests)) ->doWrite('commands.php', $this->createCommands($manifests)) ->doWrite('twig-paths.php', $this->createTwigPathsMap($manifests)) ->doWrite('login.less', $this->createLoginLess($manifests)) ->doWrite('account.less', $this->createAccountLess($manifests)); return $this; } private function createLoginLess($manifests) { $buffer = <<pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'login.less'; if (is_file($filepath)) { $relativePath = $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'login.less'; $buffer .= <<pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'account.less'; if (is_file($filepath)) { $relativePath = $manifest->getName() . DIRECTORY_SEPARATOR . 'less' . DIRECTORY_SEPARATOR . 'account.less'; $buffer .= <<pluginDirectory . DIRECTORY_SEPARATOR . $file, $data)) { throw new RegistrationFailureException(sprintf('Failed to write %s', $file)); } return $this; } private function createLoader($manifests) { $buffer = <<getName() . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php"; $buffer .= <<getServices() as $service) { $class = $service['class']; $buffer .= <<register($class::create(\$app)); EOF; } } $buffer .= <<getCommands() as $command) { $class = $command['class']; $buffer .= <<command($class::create()); EOF; } } $buffer .= <<quote('plugin-' . $manifest->getName()); $path = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'views'; if (is_dir($path)) { $path = $this->quote($path); $buffer .= << $path, EOF; } foreach ($manifest->getTwigPaths() as $path) { $path = $this->quote($this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . $path); $buffer .= <<