chencha/conveyor
最新稳定版本:0.1.6
Composer 安装命令:
composer require chencha/conveyor
包简介
A convey system for commands and requests
README 文档
README
#Command and Request Convey System
##Basic Usage
###Bootstrap Code
$userDbBelt=new UserDbBelt(); //Extends Chencha\Conveyor\Belt
$userDbBelt->registerMachines(SaveInDatabase(), new UpdateElastic());
Machines extend \Chencha\Conveyor\Machine
$mainConveyor=new Chencha\Conveyor();
$mainConveyor->registerBelt($userBelt);
###Running Belt
$userDbBelt =$mainConveyor->makeBelt(UserDbBelt::class);
$subject=new User("email"=>"test@test.com","password"=>"good_password");
$$userDbBelt->run($subject);
$subject->getResponse();
$subject->hasError();
$subject->getErrors();
##Processes
Processes are belts that are chained together. To stop a process before the next belt. A StopBeltException should be thrown.
$userRegistration= new RegistrationProcess();
$userRegistration->registerBelts($userValidation,$userDbBelt); //Ordering is important
$mainConveyor->registerProcess($userRegistration);
###Running a process $userRegistrationProcess=$mainConveyor->makeProcess(RegistrationProcess::class); $userRegistrationProcess->run($user);
##Exception StopProcessException //This exceptions will stop the process before next belt is run All other exceptions bubble up immediately
##Deploy status
This system is not ready for production use changes expected coming days
##Examples
To check the examples please see
- examples/process_example.php
- examples/belt_example.php
统计信息
- 总下载量: 36
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-09