PHP code example of deepziyu / yii2-swoole
1. Go to this page and download the library: Download deepziyu/yii2-swoole 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/ */
deepziyu / yii2-swoole example snippets
$models = User::find()->each(10);
foreach ($models as $model) { // Hang up in this row
$data[] = $model->toArray();
}
class OneModel extend ActiveRecord{
public static function tableName()
{
return 'some-table do not exist';
}
}
//导致进程终止
$model = new OneModel([
'some-att'=>'some-value',
]);
php swoole.php start|stop|reload|reload-task