symfony2奏鸣曲页面包错误

时间:2013-11-08 10:52:57

标签: php symfony symfony-sonata

如何安装奏鸣曲页面包?

我的composer.json:

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",

    "doctrine/doctrine-bundle": "~1.2",
    "doctrine/doctrine-migrations-bundle": "dev-master",
    "doctrine/migrations": "dev-master",
    "doctrine/doctrine-fixtures-bundle": "~2.2",
    "doctrine/data-fixtures": "1.0.*@dev",

    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0",

    "jms/security-extra-bundle": "1.5.*",
    "jms/di-extra-bundle": "1.4.*",

    "kriswallsmith/assetic": "1.1.0",
    "liip/imagine-bundle": "dev-master",
    "egeloen/ckeditor-bundle": "2.*",

    "symfony-cmf/routing-bundle": "~1.1",

    "knplabs/knp-markdown-bundle": "1.2.*@dev",

    "sonata-project/easy-extends-bundle": "~2.1",
    "sonata-project/seo-bundle": "~1",
    "sonata-project/doctrine-extensions": "~1",
    "sonata-project/intl-bundle": "~2.1",
    "sonata-project/admin-bundle": "~2.2",
    "sonata-project/doctrine-orm-admin-bundle": "~2.2",
    "sonata-project/notification-bundle": "~2.2",
    "sonata-project/block-bundle": "~2.2",
    "sonata-project/media-bundle": "~2.2",
    "sonata-project/cache-bundle": "~2.1",
    "sonata-project/page-bundle": "~2.3",
    "sonata-project/formatter-bundle": "~2.3",
    "sonata-project/exporter": "~1.3",
    "sonata-project/classification-bundle": "~2.2",

    "dflydev/markdown": "~1.0",
    "simplethings/entity-audit-bundle": "~0.5",
    "willdurand/faker-bundle": "~1.0",
    "stof/doctrine-extensions-bundle": "~1.1"
},

我的AppKernel.php:

        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 Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),

    new JMS\AopBundle\JMSAopBundle(),
    new JMS\DiExtraBundle\JMSDiExtraBundle($this),
    new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),

        // DOCTRINE
        new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),

        // KNP HELPER BUNDLES
        // new Knp\Bundle\MenuBundle\KnpMenuBundle(),
        new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),

        // MEDIA
        new Sonata\MediaBundle\SonataMediaBundle(),
        new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
        new Liip\ImagineBundle\LiipImagineBundle(),

        // SONATA CORE & HELPER BUNDLES
        new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
        new Sonata\jQueryBundle\SonatajQueryBundle(),
        new Sonata\AdminBundle\SonataAdminBundle(),
        new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
        new Sonata\IntlBundle\SonataIntlBundle(),
        new Sonata\FormatterBundle\SonataFormatterBundle(),
        new Sonata\CacheBundle\SonataCacheBundle(),
        new Sonata\BlockBundle\SonataBlockBundle(),
        new Sonata\SeoBundle\SonataSeoBundle(),
        new Sonata\PageBundle\SonataPageBundle(),
        new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
        new Sonata\ClassificationBundle\SonataClassificationBundle(),
        new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
        new Sonata\NotificationBundle\SonataNotificationBundle(),
        new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),

        // CMF Integration
        new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),

        new Knp\Bundle\MenuBundle\KnpMenuBundle(),
        new Ivory\CKEditorBundle\IvoryCKEditorBundle(),

当我创造&#34;阻止&#34;发现错误:

Catchable Fatal Error: Argument 3 passed to Sonata\DoctrineORMAdminBundle\Block\AuditBlockService::__construct() must be an instance of SimpleThings\EntityAudit\AuditReader, null given, called in /var/www/xxx/app/cache/dev/appDevDebugProjectContainer.php on line 4911 and defined in /var/www/xxx/vendor/sonata-project/doctrine-orm-admin-bundle/Sonata/DoctrineORMAdminBundle/Block/AuditBlockService.php line 40 

之后,添加&#34; SimpleThings \ EntityAudit \ SimpleThingsEntityAuditBundle()&#34;到AppKernel,发现:

ContextErrorException: Notice: Uninitialized string offset: 0 in /var/www/xxx/vendor/sonata-project/doctrine-orm-admin-bundle/Sonata/DoctrineORMAdminBundle/DependencyInjection/Compiler/AddAuditEntityCompilerPass.php line 63

有什么问题?

1 个答案:

答案 0 :(得分:1)

安装SonataPageBundle时,您需要安装并正确配置一组依赖项,请参阅此处的列表:http://sonata-project.org/bundles/page/master/doc/reference/installation.html

您需要查看每个指定包的安装步骤。

详情:

DoctrineORMAdminBundle使用SimpleThingsEntityAuditBundle自动审核具有管理界面的学说管理实体。

似乎你已经创建了一个管理类(一个标记为“sonata.admin”的服务)而没有为管理员指定所需的参数(或者没有继承默认的管理员)。

如果没有,请尝试清除缓存:

rm -rf app/cache/*

您可能有一个过时的容器。

如果这不起作用,请检查标记为“sonata.admin”的服务,看看它们是否具有必需的参数。