定制 sintra/pimcore-webhooks 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sintra/pimcore-webhooks

Composer 安装命令:

composer require sintra/pimcore-webhooks

包简介

A Pimcore's bundle for implementing webhooks

README 文档

README

Compile and Tests CodeFactor

This extention provide an easy way to send dataobjects to an external sites via json, whenever a pimcore event occurs on a specified class. This bundle installs the webHook class through which it is possible to define, from the UI, which dataObjects to listen for sending data to an external website, whenever a pimcore event occurs on the specified dataobject.

How to Install WebHookBundle

1. download and install the bundle from composer

For installig WebHookBundle, the first step is to open your terminal and type:

docker-compose exec php bash
composer require sintra/pimcore-webhooks:dev-main

After you have installed the Toolbox Bundle via composer, open pimcore backend and go to Tools => Extension:

  • Click the green + Button in Enable / Disable row
  • Click the green + Button in Install/Uninstall row

2. Configure the bundle

Now that the bundle is installed you can start creating your webhooks!. Follows the next stesp.

  1. create a folder called Webhooks. Although this is not mandatory and you can name it as you want.
  2. create a webhook object in it:
  • In setting panel you can specify the name of the classes to monitor, the events to listen to, and the URL of the site to send the json object
  • In the security panel, you can set an api-key to provie to the specified URS, an a pair of public/private key to generate a signature

The following video shows how this can be done in seconds. Now you are ready to use the Webhok bundle!

Webook configuration

Availbale options

You can specify:

  • The class to monitor
  • The URL to send data to
  • The event to listen

The aviable event are:

  • preAdd
  • postAdd
  • postAddFailure
  • preUpdate
  • postUpdate
  • postUpdateFailure
  • deleteInfo
  • preDelete
  • postDelete
  • postDeleteFailure
  • postCopy
  • postCsvItemExport

Once the event occurs, the json represtantion of you data is sent to the specified url. In the header it is specified which event was launched.

Each event will trigger a request like this:

  • headers
    • x-listen-event: contain the name of the event launched
    • x-apikey: contain a random generated key for autentication porpouse
    • x-signature: contain the data signature created with OPENSSL_ALGO_SHA1; public key is store in website settings
  • body contains two main parts:
    • dataObject: json representation of your dataObject
    • argumentrs: exception code and message throws if a failure occurs

Security settings

To ensure the authenticity and security of the information transmitted, in the header there are a randomly generated api-key, and a signature generated through a pair of keys (public / private), stored in the Pimcore website setting. These are created automatically when the bundle is installed, but you can use your own.

To run the tests you don't need to create any webhooks or classes, these will be created automatically, you just have to initialize the testURL attribute with a valid url.

sintra/pimcore-webhooks 适用场景与选型建议

sintra/pimcore-webhooks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.32k 次下载、GitHub Stars 达 26, 最近一次更新时间为 2021 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 sintra/pimcore-webhooks 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 4.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 26
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 26
  • Watchers: 4
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2021-03-23