Monthly Archive: June 2018

在开发环境中,执行数据库迁移命令失败:1071 Specified key was too long; max key length is 767 bytes 0

Based on yiisoft/yii2-app-advanced, create a new repository yii2-app-advanced on github, and create a new interface application (implement RESTful-style web service services. API), adjust the default character set to: utf8mb4, the adjustment of the interface response format, the empty array is automatically converted to empty objects, and the request log message is collected in the interface application (1 request corresponds to 1 log message) to the database, and the corresponding interface to implement the log function: log list (set data filter to enable filter processing), log details (2)

Post Views: 52 1. In the development environment, the execution of the database migration command fails: 1071 Specified key was too long; Max key length is 767 bytes, as shown in Figure 17 2....

在 Postman 中,GET http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/logs?filter[level]=4&filter[category][like]=api\behaviors\RequestLogBehavior&filter[prefix][like]=app-api&filter[log_time][gte]=1528090828&filter[log_time][lte]=1529564924.6648 ,200响应,空数组已经被自动转换为空对象,以保证字段格式的统一,GET http://api.github-shuijingwan-yii2-app-advanced.localhost/v1/logs/3 0

Based on yiisoft/yii2-app-advanced, create a new repository yii2-app-advanced on github, and create a new interface application (implement RESTful-style web service services. API), adjust the default character set to: utf8mb4, the adjustment of the interface response format, the empty array is automatically converted to empty objects, and the request log message is collected in the interface application (1 request corresponds to 1 log message) to the database, and the corresponding interface to implement the log function: log list (set data filter to enable filter processing), log details

Post Views: 37 1. Set the default collation of the database as: utf8mb4_unicode_ci, as shown in Figure 1 2. Modify the default character set for database connections: utf8mb4, edit the configuration file in the...

查看 Available Debug Data,请求格式为 application/json 0

HTTP client extension based on Yii 2, configure the client through application components, and send HTTP request data in JSON format

Post Views: 12 1. Configure the client through the application component, \common\config\main-local.php 2. Set the format used for the request content to json through the setFormat() method, \common\logics\http\yqdsj_api\article.php 3. When using the REST API,...

在 Postman 中测试,当 tool 参数不等于([jove, nova])时,符合预期 0

Implementation of temporary validation of some values that are not bound to any model class on Yii 2.0 (using a core validator)

Post Views: 14 1. Print out the current model 2. Now there are request parameters, TOOL, required, tool ID, jove: jove micro-editing; nova: nova fine editing, and the verification range ([jove, nova]); 3. Since...