我正在尝试在 Symfony2 上安装 JMSSerializerBundle。我在这里按照 Composer 的说明进行操作。
当我尝试实际使用 JMSSerializerBundle 时,我得到了这个:
Fatal error: Class 'JMS\SerializerBundle\JMSSerializerBundle' not found in /home/jason/pressbox/app/AppKernel.php on line 25
这是我的AppKernel.php
:
<?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\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new VNN\PressboxBundle\VNNPressboxBundle(),
new VNN\SecurityBundle\VNNSecurityBundle(),
new VNN\CoreBundle\VNNCoreBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
);
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');
}
}
我错过了什么?我需要做什么才能让它工作?