2017 © Pedro Peláez
 

yii2-extension yii2-unique-command

Yii2 command trait and behavior allows you to control uniqueness of command

image

daydiff/yii2-unique-command

Yii2 command trait and behavior allows you to control uniqueness of command

  • Monday, November 7, 2016
  • by Daydiff
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 command behavior allows you to control uniqueness of a command

How to use

use Daydiff\UniqueCommand\UniqueCommandBehavior;
use yii\console\Controller;

class UniqueController extends Controller
{

    public function behaviors()
    {
        return [
            [
                'class' => UniqueCommandBehavior::className(),
                'actions' => ['foo'] //an action foo will be unique
            ]
        ];
    }

    /**
     * Unique action
     */
    public function actionFoo()
    {
        //just if it do really long work
        sleep(5);
        return 'unique';
    }

    /**
     * Non unique action
     */
    public function actionBar()
    {
        //just if it do really long work
        sleep(5);
        return 'non-unique';
    }
}

The Versions

07/11 2016

dev-master

9999999-dev https://github.com/daydiff/yii2-unique-command

Yii2 command trait and behavior allows you to control uniqueness of command

  Sources   Download

MIT

The Requires

 

by Aleksandr Tabakov

command yii2 behavior unique daydiff uniqueness