承接 jonnsl/laravel-viewcache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jonnsl/laravel-viewcache

Composer 安装命令:

composer require jonnsl/laravel-viewcache

包简介

artisan command to compile all views.

关键字:

README 文档

README

Compile all blade views in advance.

In a Laravel application, Blade templates are compiled into plain PHP code the first time they are used and are then cached until they are modified. This means that the directory that stores the cached template (usually storage/framework/views) must be writeable by the server. During development this is not a problem at all, actually this is quite convenient. In a production environment however, this poses a security concern, since now there is a directory that is both writeable and will have php files that are executable.

Using this artisan view:cache command in a build step before uploading your application to production, the storage/framework/view and the php files inside can be made read-only. This helps to prevent unauthorized modifications to the cached view files, reducing the risk of potential security vulnerabilities that could arise from a writable directory containing executable PHP code. Also by compiling the Blade templates ahead of time, the application can serve the cached views a little bit faster the first time, as it doesn't need to compile the templates on-the-fly on the first request.

Blade template files must use the .blade.php file extension and are typically stored in the resources/views directory (the directory can be changed in config/view.php).

Installation

$ composer require jonnsl/laravel-viewcache

Usage

Usage: php artisan view:cache

Options:

  --force Compile all views regardless of their timestamp.

License

(The MIT License)

Copyright (c) 2024 Jonnathan Soares Lima <jonnsl@hotmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固