Category: PHP
-
Post Views: 21 1. The existing code is implemented as follows 2. The final generated JSON data structure is as follows: 3. The Blade {{ }} statement is automatically passed through PHP’s HtmlSpecialChars function to prevent XSS attacks. Therefore, you need {!! !!} to prevent the “(double quotes) from being converted into HTML entities. 4. However, the generated JSON structure…
-
Post Views: 14 1. There is a php Blade code block, which is placed in mysql, and its code is stored in the field schema, as shown in Figure 1 2. Some variables, already declared in the php script, the code block is shown below 3. The code of the compiled template file is as follows. 4. Decided to skip…
-
Post Views: 20 1. Execute the Composer Update in Homestead and report an error: Your requirements could not be resolved to an installable set of packages. The reason is that the PHP version is 8.0 , and the version of the package depends on 7. as shown in Figure 1 2. Reference:https://learnku.com/docs/laravel/5.8/homestead/3882#multiple-php-versions. Homestead 6 introduced support for multiple PHP versions…
-
Post Views: 13 1. Error in PHP 7.4: Illegal offset type in issue or empty. as shown in Figure 1 2. The code is as follows: 3. Print $setting, its value is the object. as shown in Figure 2 4. will $setting[‘settingId’]Convert to string. 5. The value of the printed and converted string is as follows 6. No more errors.
-
Post Views: 17 1. The value of the string: E:\wwwroot\object\storage\app/theme_dow nloads/2022/05/25/1653468314.0994.1295326141.zip 2. Values of other characters: E:\wwwroot\object\storage\app/ 3. The code is implemented as follows 4. Results: _downloads/2022/05/25/1653468314.0994.1295326141.zip. Expected is: Theme_Downloads/2022/05/25/1653468314.0994.1295326141.zip. as shown in Figure 1 5. The code implementation is adjusted as follows, remove the last / of the values of other characters 6. The results are in line with…
-
Post Views: 17 1. Reference:https://www.shuijingwanwq.com/2022/06/10/6593/, based on Togos/phpGitIgnore for parsing and applying .gitignore class rules implementation 2. Now expect that the /css, /images, /js, /locales, webpack.mix.js and other files in the /assets/apps/ directory should be ignored. The current configuration is as follows. as shown in Figure 1 3. This stage has not been ignored. For example: /apps/object/backtop/js/backtop.jsx, which should be…
-
Post Views: 16 1. In a template directory, because there are some files that need to be ignored, it is also written into the table, so it needs to be filtered out. Reference: In Laravle 6, togos/phpgitignore, implementation for parsing and applying .gitignore class rules 2. The current code implementation 3. The result is for example: the file starting with…
-
Post Views: 18 1. There is a folder at this stage, which contains a configuration file similar to .gitignore: .themeignore, the content is as follows 2. You need to ignore some files based on this file configuration, and only include the required files. For example: filter out node_modules/* . as shown in Figure 1 3. Install togos/gitignore based on composer…
-
Post Views: 20 1. Reference:https://www.php.net/manual/zh/ziparchive.extractto.php. ZipArchive::ExtractTo. Extract the compressed file to the specified directory. as shown in Figure 1 2. The final reference implementation is as follows 3. The decompressed directory structure is the same as the original file name and the same name. as shown in Figure 2
-
Post Views: 16 1. The performance of the web page is that when the request parameter is input:\, the response is 200, which in turn causes the response to 500 when the template is rendered. as shown in Figure 1 2. View the corresponding logs in the Alibaba Cloud Log Service SLS, and report an error when parsing the JSON…