orchesty/php-sdk

Orchesty的PHP SDK

3.1.1 2024-06-21 09:18 UTC

This package is auto-updated.

Last update: 2024-09-26 10:35:57 UTC


README

如何使用?

  • 安装包orchesty/php-sdk
  • 将PHP SDK中的捆绑包注册到您的Symfony应用程序中
# config/Bundles.php
 
  ...
  HbPFApplicationBundle::class     => ['all' => TRUE],
  HbPFCommonsBundle::class         => ['all' => TRUE],
  HbPFConnectorBundle::class       => ['all' => TRUE],
  HbPFConnectorsBundle::class      => ['all' => TRUE],
  HbPFCustomNodeBundle::class      => ['all' => TRUE],
  ...
  • 将PHP SDK中的路由注册到您的Symfony应用程序中
# config/routes/routing.yaml

...
hb_pf_applications:
    resource: "@HbPFApplicationBundle/Controller"
    type: annotation

hb_pf_connector:
    resource: "@HbPFConnectorBundle/Controller"
    type: annotation

hb_pf_custom_node:
    resource: "@HbPFCustomNodeBundle/Controller"
    type: annotation

hb_pf_batch:
    resource: "@HbPFBatchBundle/Controller"
    type: annotation
  • 添加节点和应用注册的位置参数
# config/services.yaml
parameters:
    node_services_dirs:
        - '%kernel.project_dir%/config'
    applications:
        - '%kernel.project_dir%/config'
  • 添加所需的环境变量
Example values:
BACKEND_DSN: 'http://127.0.0.10:8080'
STARTING_POINT_DSN: 'http://starting-point:8080'
WORKER_API_HOST: 'http://worker-api:8000'
ORCHESTY_API_KEY: 'ThisIsNotSoSecretApiKey'

如何开发

  1. 运行make init以启动开发环境
  2. 可以通过make testmake fasttest运行测试