summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-09-19 10:49:07 +0100
committerAlex Pott2014-09-19 10:49:07 +0100
commit305b2f38da238705a10e543994808ce29dbdbbc0 (patch)
tree50aeb8e53d97d00a9017bad9bf852cb12c69172f
parentc58bca379c6d92ebd1d07ac877be148968c23f86 (diff)
Issue #2309889 by tim.plunkett, dawehner: Fixed DrupalKernel requires a Drupal\Core\*\Plugin directory for annotated classes to be discovered.8.0.0-alpha15
-rw-r--r--core/lib/Drupal/Core/Datetime/Plugin/README.txt4
-rw-r--r--core/lib/Drupal/Core/DrupalKernel.php15
-rw-r--r--core/lib/Drupal/Core/Render/Plugin/README.txt4
3 files changed, 12 insertions, 11 deletions
diff --git a/core/lib/Drupal/Core/Datetime/Plugin/README.txt b/core/lib/Drupal/Core/Datetime/Plugin/README.txt
deleted file mode 100644
index f761e01..0000000
--- a/core/lib/Drupal/Core/Datetime/Plugin/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-@todo This must be here because DrupalKernel will only allow namespaces to
- provide plugins if there is a Plugin subdirectory, and git does not allow
- empty subdirectories. This file should be removed once
- https://www.drupal.org/node/2309889 is fixed.
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index b75b470..6f7b011 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -1010,13 +1010,22 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
// Get a list of namespaces and put it onto the container.
$namespaces = $this->getModuleNamespacesPsr4($this->getModuleFileNames());
- // Add all components in \Drupal\Core and \Drupal\Component that have a
- // Plugin directory.
+ // Add all components in \Drupal\Core and \Drupal\Component that have one of
+ // the following directories:
+ // - Element
+ // - Entity
+ // - Plugin
foreach (array('Core', 'Component') as $parent_directory) {
$path = DRUPAL_ROOT . '/core/lib/Drupal/' . $parent_directory;
$parent_namespace = 'Drupal\\' . $parent_directory;
foreach (new \DirectoryIterator($path) as $component) {
- if (!$component->isDot() && $component->isDir() && is_dir($component->getPathname() . '/Plugin')) {
+ /** @var $component \DirectoryIterator */
+ $pathname = $component->getPathname();
+ if (!$component->isDot() && $component->isDir() && (
+ is_dir($pathname . '/Plugin') ||
+ is_dir($pathname . '/Entity') ||
+ is_dir($pathname . '/Element')
+ )) {
$namespaces[$parent_namespace . '\\' . $component->getFilename()] = $path . '/' . $component->getFilename();
}
}
diff --git a/core/lib/Drupal/Core/Render/Plugin/README.txt b/core/lib/Drupal/Core/Render/Plugin/README.txt
deleted file mode 100644
index f761e01..0000000
--- a/core/lib/Drupal/Core/Render/Plugin/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-@todo This must be here because DrupalKernel will only allow namespaces to
- provide plugins if there is a Plugin subdirectory, and git does not allow
- empty subdirectories. This file should be removed once
- https://www.drupal.org/node/2309889 is fixed.