定制 jennchen/duckpatrol 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jennchen/duckpatrol

最新稳定版本:v1.0.3

Composer 安装命令:

composer require jennchen/duckpatrol

包简介

DuckPatrol is a PHP library designed to automatically protect your web applications from Cross-Site Request Forgery (CSRF) attacks.

README 文档

README

Overview

DuckPatrol is a PHP library developed to protect your plain PHP web applications from Cross-Site Request Forgery (CSRF) attacks. It offers a simple way to integrate CSRF protection into your projects by using Composer and providing a script for automation.

Requirements

  • PHP 7.4 or higher
  • Composer installation
  • Forms to be protected must be sent using the POST-method
  • To run the script, the PHP-process on the target system must have the required write permissions

Installation

Install DuckPatrol with Composer:

composer require jennchen/duckpatrol

Usage

There are two ways to initialize the DuckPatrol library.

Manual Initialization

One way is to manually integrate DuckPatrol into all pages you want to protect from CSRF attacks. You can do this by including the bootstrap.php file:

require_once 'path/to/vendor/jennchen/duckpatrol/bootstrap.php';

Automatic Initialization

The other way is to use the init_script.php. This script searches your entire project for PHP files that contain an HTML form with the POST method. In all these files, the bootstrap.php file will be automatically included.

To run the script, you need to navigate to the DuckPatrol folder, which is located in the vendor directory under 'jennchen'. Once you are in the library directory, you can run the script as follows:

php init_script.php

Script Configuration

If you want to set a custom root directory or exclude certain files from the script's process, you can do this in the config.php. All information on this can be found in the configuration file itself.

Acknowledgements

Thanks to everyone who supported me greatly during the creation of this library. A special thanks goes to:

  • Michael Kraftl
  • Michael Wagner
  • and everyone who helped with the name search <3

Author

Jennifer Kraftl - Developer - GitHub

License

This library is open-source software licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固