فهرست منبع

[Foundation] added kernel.bundles to the list of default parameters of the DIC

Fabien Potencier 15 سال پیش
والد
کامیت
0dcaabfc8c
2فایلهای تغییر یافته به همراه14 افزوده شده و 0 حذف شده
  1. 7 0
      src/Symfony/Foundation/Kernel.php
  2. 7 0
      src/Symfony/Foundation/bootstrap.php

+ 7 - 0
src/Symfony/Foundation/Kernel.php

@@ -180,6 +180,12 @@ abstract class Kernel
 
   public function getDefaultParameters()
   {
+    $bundles = array();
+    foreach ($this->bundles as $bundle)
+    {
+      $bundles[] = get_class($bundle);
+    }
+
     return array_merge(
       array(
         'kernel.root_dir'    => $this->rootDir,
@@ -189,6 +195,7 @@ abstract class Kernel
         'kernel.cache_dir'   => $this->rootDir.'/cache/'.$this->environment,
         'kernel.logs_dir'    => $this->rootDir.'/logs',
         'kernel.bundle_dirs' => $this->bundleDirs,
+        'kernel.bundles'     => $bundles,
         'kernel.charset'     => 'UTF-8',
       ),
       $this->getEnvParameters(),

+ 7 - 0
src/Symfony/Foundation/bootstrap.php

@@ -448,6 +448,12 @@ abstract class Kernel
 
   public function getDefaultParameters()
   {
+    $bundles = array();
+    foreach ($this->bundles as $bundle)
+    {
+      $bundles[] = get_class($bundle);
+    }
+
     return array_merge(
       array(
         'kernel.root_dir'    => $this->rootDir,
@@ -457,6 +463,7 @@ abstract class Kernel
         'kernel.cache_dir'   => $this->rootDir.'/cache/'.$this->environment,
         'kernel.logs_dir'    => $this->rootDir.'/logs',
         'kernel.bundle_dirs' => $this->bundleDirs,
+        'kernel.bundles'     => $bundles,
         'kernel.charset'     => 'UTF-8',
       ),
       $this->getEnvParameters(),