PHP code example of kriss / yii2-thread

1. Go to this page and download the library: Download kriss/yii2-thread library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kriss / yii2-thread example snippets


'components' => [
    ...
    'thread' => [
        'class' => 'kriss\thread\components\Thread',
        'enable' => true,
        'tokenValidate' => true, // 是否开启 url token 验证,默认开启
        'tokenParam' => 'token', // token 参数名
        'token' => 'suiyitianxiezijidetoken', // 随意填写自己的验证 token
    ],
    ...
]

public function actionSendMessage($message)
{
    Yii::info($message);
}

Yii::$app->thread->addThread(['/web-thread/send-message','message'=>'hello world']);

php composer.phar 

php composer.phar update