Download the PHP package zwei/event-worker without Composer

On this page you can find all versions of the php package zwei/event-worker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package event-worker

Event Worker

业务频繁的变动,频繁增减活动,导致开发修改现有的业务逻辑,造成程序很混乱,质量无法保证。 也导致测试进行了大量重复而不必要测测试,从而浪费大量的人力成本,而不能有预期到结果。

注意

Event Worker 当前版本只针对中小型企业,因为部署简单,你可以快速的安装使用。 之后会有 Event Worker RabbitMQ 就是针对大型企业,高并发业务场景。

使用场景

  1. 主要务不变,一些像活动、注册、登录、购买送积分、发短信等
  2. saas平台使用为每个客户部署环境,很多公司用docker 快速部署环境,环境创建后会导入sql,但是可能创建成功事件不确定,我们可以发送一个import_event 事件来解决这个问题

案例:

1. 用户注册

这个月是送积分,可能下个月送红包

2. 比如活动,每次节假日的活动规则不一样
  1. 3.8妇女节,女性用户登录(可以获得专属优惠券,购买商品后可以获得额外返现或者双倍积分等规则)
  2. 5.1劳动节邀请好友(获得实物大礼包,好友购买商品,送2元红包,1.5倍积分,邀请人获得3元红包,10个积分),购买商品送劳动币。
  3. 国庆节活动登录、注册、购买商品送爱国币。

问题:

  1. 登录送积分、送红包
  2. “5.1”劳动节购买商品送劳动币等
  3. 国庆登录、注册、购买送爱国比

在上面这个场景,其实登录、购买、邀请好友这些逻辑是没有变化,每次活动或者需求程序员根据需求不停的修改业务逻辑,每次更改业务,测试都要去做一些重复的测试,那么有没有办法简单化呢。

解决:

我们使用事件(Event),在注册、登录、购买、邀请好友我们都发送相应的事件(注册register_event、登录login_event、购买product_buy_event、邀请好友inviting_friend_event),我们可以监听在不同的消费者监听同一事件,例如我们登录要送积分,国庆登录又要送爱国比,那么登录登录(login_event)事件同时要送积分和爱国比,我们可以分别写2个消费者去监听登录事件,一个登录送积分消费者,一个国庆消费者送爱国比,当国庆结束我们可以停止国庆消费者。而不必关登录送积分消费者

事件发送demo

Event Worker使用示例

使用示例Event Worker App

数据库配置文件"config/bao-loan.yml"

事件、模块、计划任务配置文件"config/event-worker.conf.yml"

单元测试使用

--bootstrap 在测试前先运行一个 "bootstrap" PHP 文件

  • --bootstrap引导测试: phpunit --bootstrap vendor/autoload.php tests/
  • --bootstrap引导测试: phpunit --bootstrap tests/TestInit.php tests/

D:\phpStudy\php\php-7.0.12-nts\php.exe vendor\phpunit\phpunit\phpunit --bootstrap tests/TestInit.php tests/EventTest.php D:\phpStudy\php\php-7.0.12-nts\php.exe vendor\phpunit\phpunit\phpunit --bootstrap tests/TestInit.php tests/EventWorkTest.php D:\phpStudy\php\php-7.0.12-nts\php.exe vendor\phpunit\phpunit\phpunit --bootstrap tests/TestInit.php tests/CronConfigTest.php D:\phpStudy\php\php-7.0.12-nts\php.exe vendor\phpunit\phpunit\phpunit --bootstrap tests/TestInit.php tests/CronTest.php


All versions of event-worker with dependencies

PHP Build Version
Package Version
Requires zwei/base Version ~1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zwei/event-worker contains the following files

Loading the files please wait ....