Преглед на файлове

Cleanup handling/naming of parameter "config.path"

- Rename config.path to gearman.config.path to avoid parameter clutter in services container
- Construct full path spec in configuration rather than in code
David Zuelke преди 13 години
родител
ревизия
b42d383976
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      lib/Mmoreramerino/GearmanBundle/Resources/config/services.yml
  2. 1 1
      lib/Mmoreramerino/GearmanBundle/Service/GearmanSettings.php

+ 1 - 1
lib/Mmoreramerino/GearmanBundle/Resources/config/services.yml

@@ -1,5 +1,5 @@
 parameters:
-    config.path:                /config/gearman/
+    gearman.config.path:        %kernel.root_dir%/config/gearman/%kernel.environment%.yml
 
     gearman.client.class:       Mmoreramerino\GearmanBundle\Service\GearmanClient
     gearman.cache.class:        Mmoreramerino\GearmanBundle\Service\GearmanCache

+ 1 - 1
lib/Mmoreramerino/GearmanBundle/Service/GearmanSettings.php

@@ -76,7 +76,7 @@ class GearmanSettings extends ContainerAware
     {
         if (null === $this->filepath) {
             $rootDir = $this->container->get('kernel')->getRootDir();
-            $this->filepath = $rootDir . $this->container->getParameter('config.path') . $this->container->get('kernel')->getEnvironment().'.yml';
+            $this->filepath = $this->container->getParameter('gearman.config.path');
         }
 
         return $this->filepath;