summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-02-27 12:05:19 (GMT)
committerAlex Pott2015-02-27 12:05:19 (GMT)
commitf144ac6e7a4071286e55de45cc62bac90277cf0f (patch)
tree95486da9c364597f6f35ec368fe95f09b5bccae9
parent4b8a3c4b589a7e21159b85fe2568e77ef69f5e47 (diff)
Issue #2400261 by benjy, dawehner, tobiasb: Service Container should not store absolute paths
-rw-r--r--core/lib/Drupal/Core/DrupalKernel.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 923b747..b25a0d9 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -976,9 +976,9 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
// - Entity
// - Plugin
foreach (array('Core', 'Component') as $parent_directory) {
- $path = $this->root . '/core/lib/Drupal/' . $parent_directory;
+ $path = 'core/lib/Drupal/' . $parent_directory;
$parent_namespace = 'Drupal\\' . $parent_directory;
- foreach (new \DirectoryIterator($path) as $component) {
+ foreach (new \DirectoryIterator($this->root . '/' . $path) as $component) {
/** @var $component \DirectoryIterator */
$pathname = $component->getPathname();
if (!$component->isDot() && $component->isDir() && (
@@ -1195,7 +1195,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
protected function getModuleNamespacesPsr4($module_file_names) {
$namespaces = array();
foreach ($module_file_names as $module => $filename) {
- $namespaces["Drupal\\$module"] = $this->root . '/' . dirname($filename) . '/src';
+ $namespaces["Drupal\\$module"] = dirname($filename) . '/src';
}
return $namespaces;
}
@@ -1210,6 +1210,14 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
*/
protected function classLoaderAddMultiplePsr4(array $namespaces = array()) {
foreach ($namespaces as $prefix => $paths) {
+ if (is_array($paths)) {
+ foreach ($paths as $key => $value) {
+ $paths[$key] = $this->root . '/' . $value;
+ }
+ }
+ elseif (is_string($paths)) {
+ $paths = $this->root . '/' . $paths;
+ }
$this->classLoader->addPsr4($prefix . '\\', $paths);
}
}