From f76810709b8068fbbd3277a9c70a957497b1a708 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Tue, 19 Jan 2021 20:33:27 +0100 Subject: [PATCH] fix composer factories --- README.md | 5 ----- src/Application/Kernel.php | 8 ++++++++ src/Bundle/Command/ComposerCommand.php | 5 +++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 82a066a..6f885fc 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,6 @@ Nanbando is a simple application to automate website backups. It provides an ele backup parts. Nanbando has built-in support for various storage's and provides easy to use sync and fetch operations. It was built with modularity, extensibility and simplicity in mind. -## Status - -This repository **will become** version 1.0 of Nanbando. It is **under heavy development** and currently it's APIs and -code are not yet stable (pre 1.0). - ## Installation To install the application simply download the executable and move it to the global bin folder. diff --git a/src/Application/Kernel.php b/src/Application/Kernel.php index a006410..394ff12 100644 --- a/src/Application/Kernel.php +++ b/src/Application/Kernel.php @@ -152,6 +152,10 @@ protected function getKernelParameters() public function process(ContainerBuilder $container) { + if (!file_exists($this->embeddedComposer->getExternalComposerFilename())) { + return; + } + $container->set('composer', $this->embeddedComposer->createComposer(new NullIO())); } @@ -162,6 +166,10 @@ public function getEmbeddedComposer() protected function discoverPlugins(): array { + if (!file_exists($this->embeddedComposer->getExternalComposerFilename())) { + return []; + } + /** @var EmbeddedComposerInterface $embeddedComposer */ $embeddedComposer = $this->getEmbeddedComposer(); diff --git a/src/Bundle/Command/ComposerCommand.php b/src/Bundle/Command/ComposerCommand.php index 07ca082..5f8ebc8 100644 --- a/src/Bundle/Command/ComposerCommand.php +++ b/src/Bundle/Command/ComposerCommand.php @@ -98,4 +98,9 @@ protected function execute(InputInterface $input, OutputInterface $output) return $installer->run(); } + + public function isEnabled() + { + return file_exists($this->getApplication()->getEmbeddedComposer()->getExternalComposerFilename()); + } }