承接 oliverde8/php-etl-bundle 相关项目开发

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

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

oliverde8/php-etl-bundle

最新稳定版本:v2.0.0-alpha1

Composer 安装命令:

composer require oliverde8/php-etl-bundle

包简介

Allow usage of the PHP-ETL library in symfony framework.

关键字:

README 文档

README

Scrutinizer Code Quality Build Status Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

The Php etl bundle allows the usage of Oliver's PHP Etl library in symfony.

You should also check the PHP ETL's Easy Admin Bundle to have interfaces.

Installation

  1. Install using composer

  2. in /config/ create a directory etl

  3. Enable bundle:

    \Oliverde8\PhpEtlBundle\Oliverde8PhpEtlBundle::class => ['all' => true],
  1. Optional: Enable queue if you wish to allow users from the easy admin panel to do executions.
framework:
  messenger:
    routing:
        "Oliverde8\PhpEtlBundle\Message\EtlExecutionMessage": async
  1. Optional: Enable creation of individual files for each log by editing the monolog.yaml
etl:
    type: service
    id: Oliverde8\PhpEtlBundle\Services\ChainExecutionLogger
    level: debug
    channels: ["!event"]

Usage

Creating an ETL chain

First read the documentation of the PHP ETL

Each chain is declare in a single file. The name of the chain is the name of the file created in /config/etl/. Example:

chain:
  "Dummy Step":
    operation: rule-engine-transformer
    options:
      add: true
      columns:
        test:
          rules:
            - get : {field: [0, 'uid']}

Executing a chain

./bin/console etl:execute demo '[["test1"],["test2"]]' '{"opt1": "val1"}'

The first argument is the input, depending on your chain it can be empty. The second are parameters that will be available in the context of each link in the chain.

Additional commands

Get a definition

./bin/console etl:get-definition demo

Adding your own chain operation

To add your own chain operation you need 2 classes. The operation itself that we will call MyVendor\Etl\Operation\OurTestOperation, and a MyVendor\Etl\OperationFactory\OurTestOperationFactory factory to create it. The factory allows us to configure the operation and inject service to our operation.

All operations needs to implement DataChainOperationInterface; they can extend AbstractChainOperation.

All factories needs to extend Oliverde8\Component\PhpEtl\Builder\Factories\AbstractFactory.

The operation is a Model and not a service, you therefore need to add the path to the exclusions so that it's not made a service by symfony:

App\:
  resource: '../src/'
  exclude:
    - '../src/Etl/Operation'

Factories needs to be tagged `etl.operation-factory\ . To remove the need to tag all your factories you can add the following line your your services.yaml file

    MyVendor\Etl\OperationFactory\:
        resource: '../src/Etl/OperationFactory/'
        tags: ['etl.operation-factory']

For more information on how the etl works and how to create operations check the Php Etl Documentation

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固