Category: Web Framework
-
Post Views: 13 1. In Yii 2.0, the realization of health check, a colleague implemented a version before, I feel that it is necessary to adjust it again 2. The analysis code found that yii::$app->db->getisActive() is unnecessary. View the source code of the corresponding method separately. The related implementation of $this->pdo in getIsActive() already exists in open() . 3. Analyze…
-
Post Views: 17 1. In phpstorm prompt: Invalid vcs root mapping. The directory <project>\vendor\wartron\yii2-uuid is registered as a git root, but no git repositories were found there. as shown in Figure 1 2. Click Configure to enter the configuration interface. Discover: Vendor\Wartron\Yii2-UUID is marked red. as shown in Figure 2 3. Reference URL:https://www.shuijingwanwq.com/2020/05/11/4130/. The reason is that the directory is…
-
Post Views: 15 1. Based on the function: file_put_contents, when a string is written to the file, there are various forms in the group when defining the file name to be written to 2. Under different forms, the problem is that with the change of the running environment of the program, the file name of the written data is also…
-
Post Views: 37 1. Implement the corresponding RPC service of the page in the RPC directory, create a remote procedure call HTTP server, and create a new \RPC\Controllers\ServerController.php 2. Create a new page model \rpc\models\page.php 3. Create a new page controller, \rpc\controllers\pagecontroller.php 4. Then open the URL on the browser side:http://rpc.github-shuijingwan-yii2-app-advanced.localhost/page/create, see the following output: Fa2{u#s11″page_create”}z, as expected 5. Create…
-
Post Views: 14 1. In the domain name:http://editorweb.wjdev.chinamcloud.cnInterface in request:http://api.pcs.wjdev.chinamcloud.cn/v1/plan-tasks/274?login_id=2e368664c41b8bf511bcc9c65d86dbc3&login_tid=b26398238620e8cd15b0155cd7aee9b2, in response to 404 , the “Access-Control-Allow-Origin” header does not exist on the requested resource. as shown in Figure 1 Decide to implement a front-end AJAX request example in the local environment by yourself 3, POST request, response 200, but no response data. as shown in Figure 2 4. Refer…
-
Post Views: 19 1. In Postman, the details of the specified resource of the GET request, the response is 200, as shown in Figure 1 2. Check the routing configuration, the code is as follows 3. Check the controller, the code is as follows 4. Details of the specified resource for the POST request in Postman, the response is 404,…
-
Post Views: 13 1. When executing the Composer Update, the prompt: Package Codeception/Base is abandoned, you should avoid using it. No Replacement was Suggested., as shown in Figure 1 2. Since I am using the Yii 2 advanced project template, look at composer.json on github, and find that there are no dependencies: codeception/base, refer to:https://github.com/yiisoft/yii2-app-advanced/blob/2.0.35/composer.json, as shown in Figure 2…
-
Post Views: 14 1, CMCConsoleUser/ActionSync, existing implementation, reference:https://www.shuijingwanwq.com/2020/03/02/3964/, now need to add parameters: tenant ID 2. The parameter will be passed to the action method corresponding to the requested subcommand. Set the default value of the parameter $groupid to null 3. Determine whether the $groupId is empty, if it is not empty, and it does not exist in $HttpCMCAPiGroupIds, it…
-
Post Views: 13 1. The request interface, the total number of resources in the response parameters is 30. Resources containing ids equal to 37918 are duplicates. A total of 2. as shown in Figure 1 2. Check the model class, /common/models/redis/cmc_console/user.php 3. Check /common/components/redis/activerecord.php , which defines the prefix and applies to all AR keys. 4. Open RedisDesktopManager, check the…
-
Post Views: 11 1. When multiple database connection components have been added in Yii 2.0 2. The strategy to migrate multiple databases is to store the migration to different directories. A connection component corresponds to a directory. DB directory: /console/migrations/. Directory of statdb: /console/migrations/stat_db/. as shown in Figure 1 3. When generating the migration file under statdb, you need to…