aquis/sylius-xporter-plugin
Composer 安装命令:
composer require aquis/sylius-xporter-plugin
包简介
Plugin allowing to export and import back fixtures, in yml format.
README 文档
README
INSTALATION
To correctly install the plugin please follow the next steps
Install the plugin
dev phase
,
"repositories": [
{
"type": "path",
"url": "../SyliusXporterPlugin"
}
]
then
composer require aquis/sylius-xporter-plugin:*@dev
Fix Sylius related errors
You may get in 1.8 a strange error Attempted to load class "SecurityCheckerCommand" from namespace in bin/console can be fixed with probably from outside docker as inside will throw allowed memory:
composer require sensiolabs/security-checker
then fix missing directory
mkdir /srv/sylius/public/media/image
Enable the plugin in the bundles.php by adding at the end
... Aquis\ProductDesignConfigurator\SyliusXporterPlugin::class => ['all' => true],
Enable plugin routes
Add the following routes into your project routes.yml
sylius-aquis-xporter-plugin.admin:
# loads routes from the SyliusProductDesignConfigurator Plugin - Admin
resource: '@SyliusXporterPlugin/Resources/config/admin_routing.yml'
sylius-aquis-xporter-plugin.shop:
# loads routes from the SyliusProductDesignConfigurator Plugin - Shop
resource: '@SyliusXporterPlugin/Resources/config/shop_routing.yml'
Import configurations in _sylius.yml of your project
- { resource: "@SyliusXporterPlugin/Resources/config/packages/_sylius.yml" }
- { resource: "@SyliusXporterPlugin/Resources/config/packages/oneup_flysystem.yml" }
- { resource: "@SyliusXporterPlugin/Resources/config/packages/monolog.yml" }
Add required traits in the project entities
+++ b/src/Entity/Channel/Channel.php +use Aquis\XporterPlugin\Model\Channel\ChannelTrait; + use ChannelTrait; +++ b/src/Entity/Customer/Customer.php +use Aquis\XporterPlugin\Model\Customer\CustomerTrait; + use CustomerTrait; +++ b/src/Entity/Order/Adjustment.php +use Aquis\XporterPlugin\Model\Order\AdjustmentTrait; + use AdjustmentTrait; +++ b/src/Entity/Order/OrderItem.php +use Aquis\XporterPlugin\Model\Order\OrderItemTrait; + use OrderItemTrait; +++ b/src/Entity/Payment/PaymentMethod.php +use Aquis\XporterPlugin\Model\Payment\PaymentMethodTrait; + use PaymentMethodTrait; +++ b/src/Entity/Product/Product.php +use Aquis\XporterPlugin\Model\Product\ProductTrait as ProductTrait_EX; + use ProductTrait_EX; +++ b/src/Entity/Product/ProductAttributeValue.php +use Aquis\XporterPlugin\Model\Product\ProductAttributeValueTrait; + use ProductAttributeValueTrait; +++ b/src/Entity/Product/ProductVariant.php +use Aquis\XporterPlugin\Model\Product\ProductVariantTrait as ProductVariantTrait_EX; + use ProductVariantTrait_EX; +++ b/src/Entity/Promotion/Promotion.php +use Aquis\XporterPlugin\Model\Promotion\PromotionTrait; + use PromotionTrait; +++ b/src/Entity/Shipping/ShippingMethod.php +use Aquis\XporterPlugin\Model\Shipping\ShippingMethodTrait; + use ShippingMethodTrait; +++ b/src/Entity/Taxation/TaxRate.php +use Aquis\XporterPlugin\Model\Taxation\TaxRateTrait; + use TaxRateTrait; +++ b/src/Entity/Taxonomy/Taxon.php +use Aquis\XporterPlugin\Model\Taxonomy\TaxonTrait; + use TaxonTrait; +++ b/src/Entity/User/ShopUser.php +use Aquis\XporterPlugin\Model\User\ShopUserTrait; + use ShopUserTrait; +++ b/src/Entity/Channel/Channel.php +use Aquis\XporterPlugin\Model\Channel\ChannelTrait; + use ChannelTrait; +++ b/src/Entity/Customer/Customer.php +use Aquis\XporterPlugin\Model\Customer\CustomerTrait; + use CustomerTrait; +++ b/src/Entity/Order/Adjustment.php +use Aquis\XporterPlugin\Model\Order\AdjustmentTrait; + use AdjustmentTrait; +++ b/src/Entity/Order/OrderItem.php +use Aquis\XporterPlugin\Model\Order\OrderItemTrait; + use OrderItemTrait; +++ b/src/Entity/Payment/PaymentMethod.php +use Aquis\XporterPlugin\Model\Payment\PaymentMethodTrait; + use PaymentMethodTrait; +++ b/src/Entity/Product/Product.php +use Aquis\XporterPlugin\Model\Product\ProductTrait as ProductTrait_EX; + use ProductTrait_EX; +++ b/src/Entity/Product/ProductAttributeValue.php +use Aquis\XporterPlugin\Model\Product\ProductAttributeValueTrait; + use ProductAttributeValueTrait; +++ b/src/Entity/Product/ProductVariant.php +use Aquis\XporterPlugin\Model\Product\ProductVariantTrait as ProductVariantTrait_EX; + use ProductVariantTrait_EX; +++ b/src/Entity/Promotion/Promotion.php +use Aquis\XporterPlugin\Model\Promotion\PromotionTrait; + use PromotionTrait; +++ b/src/Entity/Shipping/ShippingMethod.php +use Aquis\XporterPlugin\Model\Shipping\ShippingMethodTrait; + use ShippingMethodTrait; +++ b/src/Entity/Taxation/TaxRate.php +use Aquis\XporterPlugin\Model\Taxation\TaxRateTrait; + use TaxRateTrait; +++ b/src/Entity/Taxonomy/Taxon.php +use Aquis\XporterPlugin\Model\Taxonomy\TaxonTrait; + use TaxonTrait; +++ b/src/Entity/User/ShopUser.php +use Aquis\XporterPlugin\Model\User\ShopUserTrait; + use ShopUserTrait;
Run the follosing command to export your data
Data can start from any entity and all related info will be dumped into a yaml file
bin/console aquis:fixture:dump App\\Entity\\Product\\Product --ids=1,3 --debug=true
Test the plugin
We are using Behat, PHPSpec and PHPUnit to test this plugin.
How to run the tests
From the plugin root directory, run the following commands:
$ (cd tests/Application && yarn install)
$ (cd tests/Application && yarn build)
$ (cd tests/Application && bin/console assets:install public -e test)
$ (cd tests/Application && bin/console doctrine:database:create -e test)
$ (cd tests/Application && bin/console doctrine:schema:create -e test)
To be able to setup a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.
Usage
Running plugin tests
-
PHPUnit
$ bin/phpunit
-
PHPSpec
$ bin/phpspec run
-
Behat
$ bin/behat
Opening Sylius with this plugin
-
Using
testenvironment:$ (cd tests/Application && bin/console sylius:fixtures:load -e test) $ (cd tests/Application && bin/console server:run -d public -e test)
-
Using
devenvironment:$ (cd tests/Application && bin/console sylius:fixtures:load -e dev) $ (cd tests/Application && bin/console server:run -d public -e dev)
done...
Sylius & API-PLATFORM
https://docs.sylius.com/en/latest/api/unified_api/introduction.html
Get the service names
bin/console debug:container | grep state_machine | grep -vE 'Transition|Definition' | awk '{ print $1 }'
Refresh js and css
bin/console assets:install web --ansi
bin/console debug:container sylius.repository.product
Install dev
COMPOSER=composer.dev.json composer install
Buy me a beer if this plugin helps you
https://www.paypal.com/donate?hosted_button_id=KNKTPJXM8PEEQ
aquis/sylius-xporter-plugin 适用场景与选型建议
aquis/sylius-xporter-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sylius」 「sylius-plugin」 「sylius aquis plugin」 「sylius petro plugin」 「sylius-xporter-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aquis/sylius-xporter-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aquis/sylius-xporter-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aquis/sylius-xporter-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Implementation of the Omnibus Directive for Sylius application.
Bulk export of sylius resources
Sylius plugin that integrates Addwish
Setono example plugin for Sylius.
Will translate fragments of text automatically
Use price tiers in your Sylius store.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2021-01-20
