From b5fed50c9f6cce9735c24f25df814e49c72e0924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateu=20Aguil=C3=B3=20Bosch?= Date: Sun, 14 Jun 2015 10:25:51 +0200 Subject: [PATCH] Use the correct class map --- bootstrap.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index 6f5541a..e724f44 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -28,7 +28,11 @@ public function register() { } // TODO: Load the *correct* composer.json in a decent OO way. // Parse the composer.json. - Loader::setClassMap(json_decode(file_get_contents('composer.json'))); + $composer_config = json_decode(file_get_contents('composer.json')); + if (empty($composer_config['class-loader']['drupal-path'])) { + return; + } + Loader::setClassMap($composer_config['class-loader']['drupal-path']); $this::load(); }