From 331bd0bcd368b2174f1ccd68773efbf3ead97047 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Thu, 20 Jul 2017 12:31:59 +0200
Subject: [PATCH] Support non-composer based Drupal installations

---
 src/Handler.php | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/Handler.php b/src/Handler.php
index bc9eb8e..e422400 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -84,17 +84,25 @@ class Handler {
     $fs = new Filesystem();
     $installationManager = $this->composer->getInstallationManager();
 
-    $drupalCorePackage = $this->getDrupalCorePackage();
-    if (!$drupalCorePackage) {
-      // We are called too early, Drupal core is not available yet.
-      return;
+    if (isset($options['webroot'])) {
+      if (!$fs->exists($options['webroot'])) {
+        return;
+      }
+      $webRoot = $options['webroot'];
+    }
+    else {
+      $drupalCorePackage = $this->getDrupalCorePackage();
+      if (!$drupalCorePackage) {
+        // We are called too early, Drupal core is not available yet.
+        return;
+      }
+      $corePath = $installationManager->getInstallPath($drupalCorePackage);
+      // Directory where Drupal's index.php is located
+      $webRoot = dirname($corePath);
     }
-    $corePath = $installationManager->getInstallPath($drupalCorePackage);
 
     // Directory where the root project is being created
     $projectRoot = getcwd();
-    // Directory where Drupal's index.php is located
-    $webRoot = dirname($corePath);
     // Directory where this plugin is being installed
     $pluginRoot = $installationManager->getInstallPath($this->getPackage('lakedrops/docker4drupal'));
 
-- 
GitLab