filsh/yii2-runner 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

filsh/yii2-runner

Composer 安装命令:

composer require filsh/yii2-runner

包简介

Component for run different objects or functions

README 文档

README

Installation

It is recommended that you install the Gearman library through composer. To do so, add the following lines to your composer.json file.

{
    "require": {
       "filsh/yii2-runner": "dev-master"
    }
}

Examples

// example runner
class Example extends \filsh\yii2\runner\BaseRunner
{
    public $fooValue;
    
    public $barValue;
    
    public function run()
    {
        echo 'example runner with param: ' . json_encode([$this->fooValue, $this->barValue]);
    }
}

// configure component
'components' => [
  'runner' => [
      'class' => 'filsh\yii2\runner\RunnerComponent',
      'runners' => [
          'example' => [
              'class' => Example::className(),
              'fooValue' => 'foo'
          ]
      ]
  ]
],

// run examples
$this->runner->run('example', ['barValue' => 'bar']); // example runner with param: ["foo","bar"]

$this->runner->run(function(array $params) {
    echo 'inline runner with params: ' . json_encode($params);
}, ['fooValue' => 'foo']); // inline runner with params: {"fooValue":"foo"}

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-25