From 37fb2c786e8d0fc8753beb9c8907503662100d88 Mon Sep 17 00:00:00 2001 From: Jonathan Hedstrom Date: Fri, 13 Feb 2015 10:49:46 -0800 Subject: [PATCH] Pull request #8. Merge branch 'marcingy-master' Signed-off-by: Jonathan Hedstrom --- src/Drupal/Driver/Cores/CoreInterface.php | 5 +++++ src/Drupal/Driver/Cores/Drupal7.php | 7 +++++++ src/Drupal/Driver/Cores/Drupal8.php | 7 +++++++ src/Drupal/Driver/DrupalDriver.php | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Drupal/Driver/Cores/CoreInterface.php b/src/Drupal/Driver/Cores/CoreInterface.php index 2b9e5fc4..1557abdf 100644 --- a/src/Drupal/Driver/Cores/CoreInterface.php +++ b/src/Drupal/Driver/Cores/CoreInterface.php @@ -31,6 +31,11 @@ public function getRandom(); */ public function bootstrap(); + /** + * Get module list. + */ + public function getModuleList(); + /** * Clear caches. */ diff --git a/src/Drupal/Driver/Cores/Drupal7.php b/src/Drupal/Driver/Cores/Drupal7.php index a66d6518..2373f746 100644 --- a/src/Drupal/Driver/Cores/Drupal7.php +++ b/src/Drupal/Driver/Cores/Drupal7.php @@ -464,4 +464,11 @@ protected function getAllPermissions() { return $permissions; } + /** + * {@inheritDoc} + */ + public function getModuleList() { + return module_list(); + } + } diff --git a/src/Drupal/Driver/Cores/Drupal8.php b/src/Drupal/Driver/Cores/Drupal8.php index 84e0ad1f..035f7d72 100644 --- a/src/Drupal/Driver/Cores/Drupal8.php +++ b/src/Drupal/Driver/Cores/Drupal8.php @@ -341,4 +341,11 @@ public function termDelete(\stdClass $term) { $term->delete(); } + /** + * {@inheritDoc} + */ + public function getModuleList() { + return \Drupal::moduleHandler()->getModuleList(); + } + } diff --git a/src/Drupal/Driver/DrupalDriver.php b/src/Drupal/Driver/DrupalDriver.php index 9e7bc06a..f7a39ced 100644 --- a/src/Drupal/Driver/DrupalDriver.php +++ b/src/Drupal/Driver/DrupalDriver.php @@ -131,7 +131,7 @@ public function getSubDriverPaths() { } // Get enabled modules. - $modules = \module_list(); + $modules = $this->getCore()->getModuleList(); $paths = array(); foreach ($modules as $module) { $paths[] = $this->drupalRoot . DIRECTORY_SEPARATOR . \drupal_get_path('module', $module);