承接 webgriffe/sylius-elasticsearch-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webgriffe/sylius-elasticsearch-plugin

Composer 安装命令:

composer require webgriffe/sylius-elasticsearch-plugin

包简介

Plugin allowing to search products in Sylius.

README 文档

README

Sylius Elasticsearch Plugin

Sylius plugin for Elasticsearch query engine.

Installation

  1. Run:

    composer require webgriffe/sylius-elasticsearch-plugin
  2. Add Webgriffe\SyliusElasticsearchPlugin\WebgriffeSyliusElasticsearchPlugin::class => ['all' => true] to your config/bundles.php.

    Normally, the plugin is automatically added to the config/bundles.php file by the composer require command. If it is not, you have to add it manually.

  3. Import the plugin configs. Add the following to your config/packages/webgriffe_sylius_elasticsearch_plugin.yaml file:

    imports:
        - { resource: "@WebgriffeSyliusElasticsearchPlugin/config/config.php" }
  4. Import the routes needed for cancelling the payments. Add the following to your config/routes.yaml file:

    webgriffe_sylius_elasticsearch_plugin:
        resource: "@WebgriffeSyliusElasticsearchPlugin/config/routes/shop.php"

    NB: if you have locales prefix enabled you should prefix import with that.

  5. Make your ProductRepository implements the DocumentTypeRepositoryInterface. Remember to update your product resource configuration to use the new repository. For example:

    sylius_product:
        resources:
            product:
                classes:
                    repository: App\Doctrine\ORM\ProductRepository
  6. Make your ProductAttribute and ProductOption entities implements the FilterableInterface. You can implement it by using our ready DoctrineORMFilterableTrait. For example:

    use Webgriffe\SyliusElasticsearchPlugin\Doctrine\ORM\FilterableTrait;use Webgriffe\SyliusElasticsearchPlugin\Model\FilterableInterface;
    
    class ProductAttribute implements FilterableInterface
    {
        use FilterableTrait;
    }

Usage

Contributing

For a comprehensive guide on Sylius Plugins development please go to Sylius documentation, there you will find the Plugin Development Guide, that is full of examples.

Quickstart Installation

Traditional

  1. Run composer create-project sylius/plugin-skeleton ProjectName.

  2. From the plugin skeleton root directory, run the following commands:

    $ (cd tests/Application && yarn install)
    $ (cd tests/Application && yarn build)
    $ (cd tests/Application && APP_ENV=test bin/console assets:install public)
    
    $ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
    $ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)

To be able to set up a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.

Docker

  1. Execute docker compose up -d

  2. Initialize plugin docker compose exec app make init

  3. See your browser open localhost

Usage

Running plugin tests

  • PHPUnit

    vendor/bin/phpunit
  • PHPSpec

    vendor/bin/phpspec run
  • Behat (non-JS scenarios)

    vendor/bin/behat --strict --tags="~@javascript"
  • Behat (JS scenarios)

    1. Install Symfony CLI command.

    2. Start Headless Chrome:

    google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
    1. Install SSL certificates (only once needed) and run test application's webserver on 127.0.0.1:8080:
    symfony server:ca:install
    APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
    1. Run Behat:
    vendor/bin/behat --strict --tags="@javascript"
  • Static Analysis

    • Psalm

      vendor/bin/psalm
    • PHPStan

      vendor/bin/phpstan analyse -c phpstan.neon -l max src/  
  • Coding Standard

    vendor/bin/ecs check

Opening Sylius with your plugin

  • Using test environment:

    (cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load)
    (cd tests/Application && APP_ENV=test bin/console server:run -d public)
  • Using dev environment:

    (cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load)
    (cd tests/Application && APP_ENV=dev bin/console server:run -d public)

webgriffe/sylius-elasticsearch-plugin 适用场景与选型建议

webgriffe/sylius-elasticsearch-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.47k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 08 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「elasticsearch」 「sylius」 「sylius-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 webgriffe/sylius-elasticsearch-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 webgriffe/sylius-elasticsearch-plugin 我们能提供哪些服务?
定制开发 / 二次开发

基于 webgriffe/sylius-elasticsearch-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-05