我无法弄清楚如何启用我的开发环境

时间:2013-01-26 19:24:51

标签: symfony

每当我尝试切换到我的开发环境时,我的网站崩溃没有任何错误(即使在apache日志中)

当我尝试运行composer update时,我总是遇到这个问题:

[Symfony的\元器件\ DependencyInjection \异常\ ServiceNotFoundException的] 服务“web_profiler.controller.profiler”依赖于不存在的服务“profiler”。

以下是我的AppKernel的内容

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
//            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
//            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
//            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
//            new JMS\AopBundle\JMSAopBundle(),
//            new JMS\DiExtraBundle\JMSDiExtraBundle($this),
//            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
            new Zepluf\Bundle\StoreBundle\StoreBundle(),
        );

        if (in_array($this->getEnvironment(), array('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();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}

我的composer.json:

{
    "name": "zepluf/standard-edition",
    "description": "The \"ZePLUF Standard Edition\" distribution",
    "authors": [
        {
            "name": "Raine Ng",
            "email": "vunguyen@rubikin.com",
            "homepage": "http://rubikin.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "": "src/",
            "Zepluf" : "src/Zepluf/",
            "plugins": "app/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "composer/installers": "*",
        "zepluf/installer": "*",
        "symfony/symfony": "2.2.*",
        "symfony/framework-bundle": ">=2.1",
        "symfony/web-profiler-bundle": "2.2.*@dev",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "zepluf/plugin-ricache": "dev-master",
        "zepluf/plugin-ricjloader": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

我想知道发生了什么以及如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

要回答我自己的问题,如果我想使用web_profiler,我需要在配置文件中设置探查器。

所以我在config_dev.yml中使用了类似的东西:

framework:
  profiler: { only_exceptions: false }