Author: 永夜
-
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,…
-
Post Views: 15 1. Open in the browser:http://frontend.cmcp-api.localhost/, a debugger toolbar will appear at the bottom of the page, you can click to expand, as shown in Figure 1 2. In Postman, gethttp://www.cmcp-api.localhost/v1/pages, 200 responses, but no debugger toolbar appears, as shown in Figure 2 3. Continue to step 1, click the Yii logo on the debugger toolbar, you can…
-
Post Views: 11 1. When executing: composer update, prompt: no valid bower.json was found in any branch or tag ofhttps://github.com/blueimp/JavaScript-Canvas-to-Blob.git,cou LD not load a package from it. As shown in Figure 1 2. Execute:composer global require “fxp/composer-asset-plugin”, update the Composer Asset plugin to the latest version, as shown in Figure 2 3. It is suspected that the network problem caused…