michalsn / codeigniter-signed-url
为CodeIgniter 4框架提供URL签名功能
v2.1.0
2023-10-08 17:58 UTC
Requires
- php: ^8.0
Requires (Dev)
- codeigniter4/devkit: ^1.0
- codeigniter4/framework: ^4.4
- rector/rector: 0.18.5
This package is auto-updated.
Last update: 2024-09-22 11:33:35 UTC
README
防止手动操作URL和自动过期URL。
安装
composer require michalsn/codeigniter-signed-url
概述
我们可以使用两种主要方法轻松地对URL进行签名,这两种方法与CodeIgniter URL辅助函数类似。
echo signedurl()->siteUrl('controller/method?query=string'); // https://example.com/controller/method?query=string&signature=signature-goes-here
echo signedurl()->setExpiration(DAY * 2)->urlTo('namedRoute', 12); // https://example.com/route/name/12?expiration=1671980371&signature=signature-goes-here
版本
版本不兼容 - 在一个版本的Signed URL中生成的URL无法与另一个版本一起工作。