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';
}
}
Yii2 command trait+behavior allows you to control uniqueness of command
License
daydiff/yii2-unique-command
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Yii2 command trait+behavior allows you to control uniqueness of command
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published