Year: 2018
-
Post Views: 14 1. Preliminary suspicion is a problem caused by the BOM header, save as the code in EditPlus: UTF-8 + BOM, as shown in Figure 1 2. Execute git commit, the difference: the text is the same, but the file does not match. The following differences are found: encoding method (ASCII, UTF-8 BOM), as shown in Figure 2…
-
Post Views: 17 1. The data structure of HTML is as follows, and now it needs to be extracted: video description. . . . , that is, the data in the first p tag 2. Search on github: yii2 html dom, and finally choose: garyjl/yii2-simple_html_dom, as shown in Figure 1 3. Execute the command: composer require –prefer-dist garyjl/yii2-simple_html_dom “*”, the…
-
Post Views: 16 1. To implement an interface to obtain the list of articles, you need to query the data based on the date control, as shown in Figure 1 2. The configuration of the verification rules is as follows 3. From_created_at, to_created_at are all empty, the verification is passed, as shown in Figure 2 4. Date (DateTime, example: 2017-03-03…
-
Post Views: 14 1. In PHP 7.1 and Yii 2, AR activity records transactions, and the implementation of multiple models needs to be operated at the same time, as shown in Figure 1 2. Test whether the transaction is supported, and let the $this->save() operation fail, and let the $contentDetail->save() operation succeed, the response is as follows, as shown in…
-
Post Views: 12 1. The image is successfully built in Jenkins, as shown in Figure 1 2. Execute the upgrade in Rancher and report an error: sed: -e expression #1, char 36: unknownd option toS, as shown in Figure 2 3. Replace the / in the .sh file with @, as shown in Figure 3 sed -i “s/cmcp_api_cfg_yii_debug/$cmcp_api_cfg_yii_debug/g” /sobey/www/cmcp-api/.env; be…
-
Post Views: 13 1. Edit the cached controller class, \API\Controllers\CacheController.php 2. Create the data layer of the cached resource class (the corresponding model language package file), \common\models\redis\cache.php 3. Create the logical layer of the cached resource class, \common\logics\redis\cache.php 4. In the interface application, create a cached resource class, \API\Models\Redis\Cache.php 5. In the V1 module of the interface application, create the…
-
Post Views: 15 1. Create the controller class of the cache component, \API\Controllers\CacheComponentController.php 2. Create the data layer of the resource class of the cache component (the corresponding model language package file), \common\models\redis\cachecomponent.php 3. Create the logical layer of the resource class of the cache component, \common\logics\redis\cachecomponent.php 4. In the interface application, create the resource class of the cache component,…
-
Post Views: 14 1. The previous article:https://www.shuijingwanwq.com/2018/01/18/2328/ 2. Refer to step 11, the DB component is moved to the development environment to facilitate the use of GII, \common\config\base.php, as shown in Figure 1 3. Configured as a production environment, so that the multi-tenant implementation of the test database migration is not dependent on the DB component, as shown in Figure…
-
Post Views: 13 1. The multi-tenant system contains multiple tenants, and each tenant has its own database configuration information. The existing requirement is to connect the database based on the response host name, user name and password, as shown in Figure 1. 2. Now it is configured as an application component, \common\config\base.php, as shown in Figure 2 3. Open dubug,…