Category: PHP
-
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: 57 1. Error report: unserialize(): unexpected end of serialized data, as shown in Figure 1 4. Edit \framework\web\CurlManager.php, and print out self::cache_key, as shown in Figure 4 5. Print the result, its value is: yii.curlmanager.rules, as shown in Figure 5 6. Open the URL: https://github.com/yiisoft/yii/issues/4137 and find that there is the same problem, as shown in Figure…
-
Post Views: 13 1. Edit \app\config\core.php, configure::write(debug, 2), as shown in Figure 1 2. Edit \App\View\Layouts\Base.ctp, <?php echo $this->element(sql_dump); ?>, as shown in Figure 2 3. After the GET request, print out the SQL statement that has been executed in the view, as shown in Figure 3 4. If it is a POST request, after the final execution is successful,…
-
Post Views: 15 1. Under PHP 7.0.22 and CakePHP 2.10.3, error: the datasource configuration tmp was not found in database.php., as shown in Figure 1 2. Print $this->UsedbConfig, its value is TMP, as shown in Figure 2 3. Make sure that $tmp does not exist in database.php, as shown in Figure 3 4. However, it was normal to confirm in…
-
Post Views: 12 1. Under CakePHP 2.6.4, the error is reported: Error: Cannot usestringAs class name as it is reserved, as shown in Figure 1 2. String is the reserved name in PHP 7.x, so the String class in the Cake cannot be used on PHP 7.x, upgrade to the latest 2.x, and use CakeText instead, as shown in Figure…
-
Post Views: 13 1. I wrote a blog under PHP 5.6.27 before:https://www.shuijingwanwq.com/en/2017/09/11/10209/, this time under PHP 7.0.22, as shown in Figure 1 2. Uninstall memcached, you can use the following command: as shown in Figure 2 schtasks /delete /tn memcached 3. Delete the directory: C:\memcached-1.4.5, as shown in Figure 3 4. Open the URL:https://github.com/nono303/memcached/tree/master/cygwin/x64, download: cygevent-2-0-5.dll, cygwin1.dll, memcached-1.5.1.exe, as shown…