Skip to content

Commit b8641e6

Browse files
mglamanandig
authored andcommitted
Check for autoloader if Drupal built with Composer (#96)
1 parent 086def5 commit b8641e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Bootstraps/Drupal.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ public function initialize($appenv, $debug)
4444
public function getApplication()
4545
{
4646
//load drupals autoload.php, so their classes are available
47-
$autoloader = require './vendor/autoload.php';
47+
if (file_exists('./vendor/autoload.php')) {
48+
$autoloader = require './vendor/autoload.php';
49+
} else {
50+
$autoloader = require '../vendor/autoload.php';
51+
}
4852

4953
$sitePath = 'sites/default';
5054

@@ -55,4 +59,4 @@ public function getApplication()
5559

5660
return $app;
5761
}
58-
}
62+
}

0 commit comments

Comments
 (0)