我安装了Sylius如下:
$ composer create-project sylius/sylius
$ cd sylius
$ php app/console sylius:install
已安装的版本:Symfony 2.7.7和Sylius 0.17
所有事情都运转良好,直到我做作曲家更新。这是Symfony更新到2.8.4-dev。我在composer.json中没有改变任何东西。现在,如果我调用app_dev.php
,我会在startpage上出现错误在SyliusWebBundle:Frontend:layout.html.twig第97行渲染模板(“Doctrine is not available。”)期间抛出了异常。 500内部服务器错误 - Twig_Error_Runtime 1个链接异常:
RuntimeException »
Debug-Info:CRITICAL - 未捕获的PHP异常Twig_Error_Runtime:“在第97行的”SyliusWebBundle:Frontend:layout.html.twig“中呈现模板(”Doctrine is available。“)期间抛出异常“。在/.../vendor/twig/twig/lib/Twig/Template.php第182行
如何在编辑器更新中保留Symfony和Sylius的版本号?
2016年4月5日更新:
作曲家的结果显示-i sylius / sylius:
name : sylius/sylius
descrip. : E-Commerce platform for PHP, based on Symfony framework.
keywords :
versions : * v0.17.0
type : project
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
source : [git] https://github.com/Sylius/Sylius.git 73397b078f2b34982040b4bcfc8b79532262966d
dist : [zip] https://api.github.com/repos/Sylius/Sylius/zipball/73397b078f2b34982040b4bcfc8b79532262966d 73397b078f2b34982040b4bcfc8b79532262966d
names : sylius/sylius, sylius/addressing, sylius/addressing-bundle, sylius/admin-bundle, sylius/api-bundle, sylius/archetype, sylius/archetype-bundle, sylius/attribute, sylius/attribute-bundle, sylius/cart, sylius/cart-bundle, sylius/contact, sylius/contact-bundle, sylius/content-bundle, sylius/core, sylius/core-bundle, sylius/currency, sylius/currency-bundle, sylius/fixtures-bundle, sylius/flow-bundle, sylius/installer-bundle, sylius/inventory, sylius/inventory-bundle, sylius/locale, sylius/locale-bundle, sylius/money-bundle, sylius/order, sylius/order-bundle, sylius/payment, sylius/payment-bundle, sylius/payum-bundle, sylius/pricing, sylius/pricing-bundle, sylius/product, sylius/product-bundle, sylius/promotion, sylius/promotion-bundle, sylius/rbac, sylius/rbac-bundle, sylius/registry, sylius/report, sylius/report-bundle, sylius/resource, sylius/resource-bundle, sylius/search-bundle, sylius/sequence, sylius/sequence-bundle, sylius/settings-bundle, sylius/shipping, sylius/shipping-bundle, sylius/storage, sylius/taxation, sylius/taxation-bundle, sylius/taxonomy, sylius/taxonomy-bundle, sylius/theme-bundle, sylius/translation, sylius/translation-bundle, sylius/ui-bundle, sylius/user, sylius/user-bundle, sylius/variation, sylius/variation-bundle, sylius/web-bundle
autoload
psr-0
Sylius\ => src/
requires
a2lix/translation-form-bundle ~2.0
doctrine/collections ~1.2
doctrine/common ~2.5
doctrine/doctrine-bundle ~1.3
doctrine/doctrine-cache-bundle ~1.0
doctrine/doctrine-fixtures-bundle ~2.2
doctrine/doctrine-migrations-bundle ~1.0
doctrine/orm ^2.4.8,<2.5
doctrine/phpcr-odm ^1.3
ext-exif *
ext-fileinfo *
ext-gd *
friendsofsymfony/elastica-bundle ^3.0.2
friendsofsymfony/oauth-server-bundle ~1.4
friendsofsymfony/rest-bundle ~1.5
fzaninotto/faker ~1.2
hwi/oauth-bundle ~0.3
incenteev/composer-parameter-handler ~2.0
jackalope/jackalope ^1.1.4
jackalope/jackalope-doctrine-dbal ^1.1.2
jms/serializer-bundle ^0.13|^1.0
jms/translation-bundle ~1.1
knplabs/knp-gaufrette-bundle ~0.1
knplabs/knp-menu-bundle ~1.1
knplabs/knp-snappy-bundle ~1.2
liip/imagine-bundle ~1.0
ocramius/proxy-manager ^1.0
omnipay/omnipay ~2.3
payum/omnipay-bridge ~1.0
payum/payum ~1.0
payum/payum-bundle ~1.0
php ^5.5.9|^7.0
sensio/distribution-bundle ~3.0
stof/doctrine-extensions-bundle ~1.1
swiftmailer/swiftmailer ~5.0
symfony-cmf/block-bundle ~1.2
symfony-cmf/content-bundle ~1.2
symfony-cmf/create-bundle ~1.2
symfony-cmf/media-bundle ~1.2
symfony-cmf/menu-bundle ~1.2
symfony-cmf/routing-bundle ^1.4.0-RC1
symfony/assetic-bundle ^2.6
symfony/event-dispatcher ^2.7
symfony/expression-language ^2.7
symfony/form ^2.7
symfony/framework-bundle ^2.7
symfony/intl ^2.7
symfony/monolog-bundle ^2.7
symfony/options-resolver ^2.7
symfony/polyfill-iconv ~1.0
symfony/polyfill-intl-icu ~1.0
symfony/polyfill-mbstring ~1.0
symfony/property-access ^2.7
symfony/proxy-manager-bridge ^2.7
symfony/swiftmailer-bundle ^2.3
symfony/symfony ^2.7.7
symfony/twig-bundle ^2.7
twig/extensions ~1.0
twig/twig ~1.11
white-october/pagerfanta-bundle ~1.0
willdurand/hateoas-bundle ^0.4|^1.0
winzou/state-machine-bundle ~0.2
zendframework/zend-hydrator ^1.0|^2.0
zendframework/zend-stdlib ^2.0|^3.0
requires (dev)
akeneo/phpspec-skip-example-extension ~1.2
behat/behat ~3.0
behat/mink ~1.6
behat/mink-browserkit-driver ~1.2
behat/mink-extension ~2.0
behat/mink-selenium2-driver ~1.2
behat/symfony2-extension ~2.0
bossa/phpspec2-expect ^1.0
coduo/php-matcher ^2.1@dev
fabpot/php-cs-fixer ^1.11
lakion/api-test-case ^1.0@dev
lakion/mink-debug-extension ^1.0.3
malukenho/kawaii-gherkin ^0.1.2
matthiasnoback/symfony-config-test ^1.4
matthiasnoback/symfony-dependency-injection-test ^0.7.6
phpspec/phpspec ^2.4
phpunit/phpunit ~4.1
se/selenium-server-standalone ^2.52
suggests
ext-iconv For better performance than using Symfony Polyfill Component
ext-intl For better performance than using Symfony Polyfill Component
ext-mbstring For better performance than using Symfony Polyfill Component
replaces
sylius/addressing self.version
sylius/addressing-bundle self.version
sylius/admin-bundle self.version
sylius/api-bundle self.version
sylius/archetype self.version
sylius/archetype-bundle self.version
sylius/attribute self.version
sylius/attribute-bundle self.version
sylius/cart self.version
sylius/cart-bundle self.version
sylius/contact self.version
sylius/contact-bundle self.version
sylius/content-bundle self.version
sylius/core self.version
sylius/core-bundle self.version
sylius/currency self.version
sylius/currency-bundle self.version
sylius/fixtures-bundle self.version
sylius/flow-bundle self.version
sylius/installer-bundle self.version
sylius/inventory self.version
sylius/inventory-bundle self.version
sylius/locale self.version
sylius/locale-bundle self.version
sylius/money-bundle self.version
sylius/order self.version
sylius/order-bundle self.version
sylius/payment self.version
sylius/payment-bundle self.version
sylius/payum-bundle self.version
sylius/pricing self.version
sylius/pricing-bundle self.version
sylius/product self.version
sylius/product-bundle self.version
sylius/promotion self.version
sylius/promotion-bundle self.version
sylius/rbac self.version
sylius/rbac-bundle self.version
sylius/registry self.version
sylius/report self.version
sylius/report-bundle self.version
sylius/resource self.version
sylius/resource-bundle self.version
sylius/search-bundle self.version
sylius/sequence self.version
sylius/sequence-bundle self.version
sylius/settings-bundle self.version
sylius/shipping self.version
sylius/shipping-bundle self.version
sylius/storage self.version
sylius/taxation self.version
sylius/taxation-bundle self.version
sylius/taxonomy self.version
sylius/taxonomy-bundle self.version
sylius/theme-bundle self.version
sylius/translation self.version
sylius/translation-bundle self.version
sylius/ui-bundle self.version
sylius/user self.version
sylius/user-bundle self.version
sylius/variation self.version
sylius/variation-bundle self.version
sylius/web-bundle self.version
答案 0 :(得分:1)
第二个想法,在审查了最后一次提交到symfony-cmf / core-bundle
之后https://github.com/symfony-cmf/core-bundle/commit/d47ac0f193139a90ecece20c46f42e588213824e
更好的解决方法是将以下内容添加到主config.yml:
cmf_core:
persistence:
phpcr:
enabled: true
这将允许setter函数在Symfony \ Cmf \ Bundle \ CoreBundle \ DependencyInjection \ CmfCoreExtension中注入ManagerRegistry服务
我认为此异常的原因是Doctrine \ Bundle \ PHPCRBundle \ ManagerRegistry服务未被注入Symfony \ Cmf \ Bundle \ CoreBundle \ Templating \ Helper \ CmfHelper构造函数。 < / p> <击>
尝试将<argument type="service" id="doctrine_phpcr" on-invalid="ignore"/>
添加到symfony-cmf依赖注入服务配置文件中
symfony-cmf/core-bundle/Resources/config/services.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="cmf_core.persistence.phpcr.manager_name">null</parameter>
<parameter key="cmf_core.twig_extension.class">Symfony\Cmf\Bundle\CoreBundle\Twig\Extension\CmfExtension</parameter>
<parameter key="cmf_core.templating.helper.class">Symfony\Cmf\Bundle\CoreBundle\Templating\Helper\CmfHelper</parameter>
</parameters>
<services>
<service id="cmf_core.twig.children_extension" class="%cmf_core.twig_extension.class%" public="false">
<argument type="service" id="cmf_core.templating.helper"/>
<tag name="twig.extension"/>
</service>
<service id="cmf_core.templating.helper" class="%cmf_core.templating.helper.class%" public="false">
<argument type="service" id="cmf_core.publish_workflow.checker" on-invalid="ignore"/>
<argument type="service" id="doctrine_phpcr" on-invalid="ignore"/>
<tag name="templating.helper" alias="cmf"/>
</service>
</services>
</container>
击> <击> 撞击>