2017 © Pedro Peláez
 

yii2-extension yii2-runner

Component for run different objects or functions

image

filsh/yii2-runner

Component for run different objects or functions

  • Sunday, May 17, 2015
  • by Filsh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 98 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

yii2-runner

Installation

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

{
    "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"}

The Versions

17/05 2015

dev-master

9999999-dev https://github.com/filsh/yii2-runner

Component for run different objects or functions

  Sources   Download

MIT

The Requires

 

by Igor Maliy

extension yii