2014-03-12 51 views
1

我在Symfony2.4項目工作,我決定進入生產環境,但清空緩存生產,當我得到這個錯誤:服務sensio_distribution.webconfigurator沒有發現

[Symfony的\分量\ DependencyInjection \異常\ ServiceNotFoundException] 您已請求不存在的服務 「sensio_distribution.webconfigurator」。

在使用這個服務,但我搜索的文件「webconfigurator.xml」,我發現 文件路徑被稱爲「sensio_distribution.webconfigurator」的服務......我不知道的是以下幾點:

供應商/ SENSIO /包/ DIstributionBundle /資源/配置/ webconfigurator.xml

這是文件:

<?xml version="1.0" ?> 

<container xmlns="http://symfony.com/schema/dic/services" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> 

    <parameters> 
     <parameter key="sensio_distribution.webconfigurator.class">Sensio\Bundle\DistributionBundle\Configurator\Configurator</parameter> 
    </parameters> 

    <services> 
     <service id="sensio_distribution.webconfigurator" class="%sensio_distribution.webconfigurator.class%"> 
      <argument>%kernel.root_dir%</argument> 
     </service> 

     <!-- deprecated, kept for BC --> 
     <service id="sensio.distribution.webconfigurator" alias="sensio_distribution.webconfigurator" /> 
    </services> 
</container> 

那麼,爲什麼我有這個錯誤?

編輯:的SENSIO分佈束裝在AppKernel.php

if (in_array($this->getEnvironment(), array('prod', 'dev', 'test'))) { 
      $bundles[] = new Acme\DemoBundle\AcmeDemoBundle(); 
      $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 
      $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 
      $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
     } 
+0

SensioDistributionBundle並未被意外刪除在AppKernel.php中? –

+0

不,SensioDistributionBundle已加載到AppKernel.php中... – DOZ

回答

0

我發現我的錯誤:

,我不得不將我捆了Acme外的 「如果」 條件,刪除「prod」:

if (in_array($this->getEnvironment(), array('prod', 'dev', 'test')))

,它的工作原理:)

相關問題