diff --git a/BaseHandler.php b/BaseHandler.php index 102aa60e0d1c0dc0a3ec5a766a259bbf7c482d3a..9a2ee41554ad2b4c39d3862c73db7427045a713c 100644 --- a/BaseHandler.php +++ b/BaseHandler.php @@ -34,7 +34,7 @@ abstract class BaseHandler implements BaseHandlerInterface { * * @var \LakeDrops\Component\Composer\Config */ - protected $config; + public $config; /** * @var \Symfony\Component\Console\Input\InputInterface @@ -71,9 +71,17 @@ abstract class BaseHandler implements BaseHandlerInterface { public function __construct(Composer $composer, IOInterface $io) { $this->composer = $composer; $this->io = $io; - $this->env = new Dotenv('docker4drupal', $this->io); - $this->config = new Config($this->configId(), $this->configDefault(), $this->env); - $this->postInit(); + } + + /** + * Initialize configuration. + */ + protected function init(): void { + if ($this->config === NULL) { + $this->env = new Dotenv($this->configId(), $this->io); + $this->config = new Config($this->configId(), $this->configDefault(), $this->env); + $this->postInit(); + } } /**