我已经安装了 sylius
composer create-project -s dev sylius/sylius
cd sylius
app/console sylius:install
我添加了自己的 Bundle,它扩展了 SyliusWebBundle 和其他一些东西。当然我有更改 parameters.yml 等。
如何更新 Sylius 的部分内容?供应商是通过 composer update 更新的,但是 src 文件夹中的 SyliusBundles 呢?
我已经安装了 sylius
composer create-project -s dev sylius/sylius
cd sylius
app/console sylius:install
我添加了自己的 Bundle,它扩展了 SyliusWebBundle 和其他一些东西。当然我有更改 parameters.yml 等。
如何更新 Sylius 的部分内容?供应商是通过 composer update 更新的,但是 src 文件夹中的 SyliusBundles 呢?
这是我的解决方案(可能有点傻):
安装 Sylius 后,正如你提到的住所,我改变了composer.json
这样的:
"require": {
"php": ">=5.3.3",
"doctrine/doctrine-bundle": "1.2.*@dev",
"doctrine/orm": "~2.3",
"friendsofsymfony/rest-bundle": "~1.0",
"friendsofsymfony/user-bundle": "2.0.*@dev",
"hwi/oauth-bundle": "0.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"jms/serializer-bundle": "0.12.*",
"jms/translation-bundle": "1.1.*",
"knplabs/knp-gaufrette-bundle": "*@dev",
"knplabs/knp-snappy-bundle": "*@dev",
"knplabs/gaufrette": "0.2.*@dev",
"liip/doctrine-cache-bundle": "*",
"liip/imagine-bundle": "~0.9",
"mathiasverraes/money": "*@dev",
"sensio/distribution-bundle": "2.3.*",
"sensio/generator-bundle": "~2.3",
"stof/doctrine-extensions-bundle": "1.1.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/intl": "~2.3",
"symfony/monolog-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/symfony": "~2.3",
"twig/extensions": "1.0.*",
"white-october/pagerfanta-bundle": "1.0.*@dev",
"pagerfanta/pagerfanta": "1.0.*@dev",
"payum/payum": "0.7.*",
"payum/payum-bundle": "~0.7.1",
"symfony-cmf/block-bundle": "1.0.*",
"symfony-cmf/content-bundle": "1.0.*",
"symfony-cmf/routing-bundle": "1.1.*",
"symfony-cmf/menu-bundle": "1.0.*",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-migrations-bundle": "dev-master",
"sylius/resource-bundle": "1.0.*@dev",
"sylius/flow-bundle": "1.0.*@dev",
"sylius/product-bundle": "1.0.*@dev",
"sylius/variable-product-bundle": "1.0.*@dev",
"sylius/money-bundle": "1.0.*@dev",
"sylius/order-bundle": "1.0.*@dev",
"sylius/cart-bundle": "1.0.*@dev",
"sylius/taxation-bundle": "1.0.*@dev",
"sylius/shipping-bundle": "1.0.*@dev",
"sylius/addressing-bundle": "1.0.*@dev",
"sylius/promotions-bundle": "1.0.*@dev",
"sylius/inventory-bundle": "1.0.*@dev",
"sylius/taxonomies-bundle": "1.0.*@dev",
"sylius/settings-bundle": "1.0.*@dev",
"sylius/payments-bundle": "1.0.*@dev",
"sylius/payum-bundle": "1.0.*@dev",
"sylius/omnipay-bundle": "1.0.*@dev",
"sylius/core-bundle": "1.0.*@dev",
"sylius/installer-bundle": "1.0.*@dev"
},
"require-dev": {
"behat/behat": "2.4.*@stable",
"behat/symfony2-extension": "*",
"behat/mink-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-goutte-driver": "*",
"behat/mink-selenium2-driver": "*",
"doctrine/doctrine-fixtures-bundle": "2.2.*",
"fzaninotto/faker": "1.2.*",
"phpspec/phpspec": "2.0.*@dev"
},
之后去并删除除 WebBundle 之外的所有捆绑包(因为 CMF 捆绑包SymfonyCMF 不兼容问题src/Sylius/Bundle
存在一些问题)。
现在您可以更新 Sylius 捆绑包,compose update
并且仍然可以使用您的捆绑包扩展它们。
PhlipSymfonyCMF
在他的回答中提到的问题现在已经解决,这意味着您现在可以将其集成到WebBundle
您的包控件中。除了 Phlip 列出的捆绑包列表之外,我还需要添加knplabs/gaufrette
以成功将 Sylius 转移到 Composer(从src/
到vendor/
)。
更新的包列表composer.json
:
"require": {
"php": ">=5.3.3",
"doctrine/doctrine-bundle": "~1.3@dev",
"doctrine/orm": "~2.3",
"friendsofsymfony/rest-bundle": "~1.0",
"friendsofsymfony/user-bundle": "2.0.*@dev",
"hwi/oauth-bundle": "0.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"jms/serializer-bundle": "0.12.*",
"jms/translation-bundle": "1.1.*",
"knplabs/knp-gaufrette-bundle": "*@dev",
"knplabs/knp-snappy-bundle": "*@dev",
"liip/doctrine-cache-bundle": "*",
"liip/imagine-bundle": "~0.9",
"mathiasverraes/money": "*@dev",
"sensio/distribution-bundle": "2.3.*",
"stof/doctrine-extensions-bundle": "1.1.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/intl": "~2.3",
"symfony/monolog-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/symfony": "~2.3",
"symfony/expression-language": "~2.4",
"twig/extensions": "1.0.*",
"white-october/pagerfanta-bundle": "1.0.*@dev",
"pagerfanta/pagerfanta": "1.0.*@dev",
"payum/payum": "~0.7.2",
"payum/payum-bundle": "~0.7.3",
"symfony-cmf/block-bundle": "1.0.*",
"symfony-cmf/content-bundle": "1.0.*",
"symfony-cmf/routing-bundle": "1.1.*",
"symfony-cmf/menu-bundle": "1.0.*",
"knplabs/gaufrette": "0.2.*@dev",
"sylius/resource-bundle": "1.0.*@dev",
"sylius/flow-bundle": "1.0.*@dev",
"sylius/product-bundle": "1.0.*@dev",
"sylius/variable-product-bundle": "1.0.*@dev",
"sylius/money-bundle": "1.0.*@dev",
"sylius/order-bundle": "1.0.*@dev",
"sylius/cart-bundle": "1.0.*@dev",
"sylius/taxation-bundle": "1.0.*@dev",
"sylius/shipping-bundle": "1.0.*@dev",
"sylius/addressing-bundle": "1.0.*@dev",
"sylius/promotions-bundle": "1.0.*@dev",
"sylius/inventory-bundle": "1.0.*@dev",
"sylius/taxonomies-bundle": "1.0.*@dev",
"sylius/settings-bundle": "1.0.*@dev",
"sylius/payments-bundle": "1.0.*@dev",
"sylius/payum-bundle": "1.0.*@dev",
"sylius/omnipay-bundle": "1.0.*@dev",
"sylius/core-bundle": "1.0.*@dev",
"sylius/installer-bundle": "1.0.*@dev",
"sylius/web-bundle": "1.0.*@dev"
},
在此之后,您可以删除您的src/Sylius
文件夹并使用composer update
.