ssitu/winnipeg

极小的蜜罐工具。

v1.0.0 2021-06-25 12:05 UTC

This package is auto-updated.

Last update: 2024-09-04 10:36:54 UTC


README

极小的蜜罐工具。

入门指南

$ composer require ssitu/winnipeg

还需要 SSITU/Blueprints

  • FlexLogsTrait
  • FlexLogsInterface 特别。

这是一个带有回退功能的 Psr-3 "logger aware" 实现。
如果没有使用其他 SSITU 蓝图,您可以只下载这两个文件。

如何使用

可以为 Winnipeg 实例设置字段 id,或者在方法调用时设置,或者根本不设置 - 默认字段 id 是:fluffandstuff

use SSITU\Winnipeg\Winnipeg;

require_once '/path/to/vendor/autoload.php';

$Winnipeg = new Winnipeg();
# or
$fieldId = 'jovialTastiness';
$Winnipeg = new Winnipeg($fieldId);
# or
$Winnipeg = new Winnipeg();
$Winnipeg->setFieldId($fieldId);

# optional:
$Winnipeg->setLogger($somePsr3Logger);

$htmlField = $Winnipeg->getHoneyPotHtml();
$css = $Winnipeg->getHoneyPotCss();
$isHoneyPotEmpty = $Winnipeg->honeyPotIsEmpty();
# or
$htmlField = $Winnipeg->getHoneyPotHtml($fieldId);
$css = $Winnipeg->getHoneyPotCss($fieldId);
$isHoneyPotEmpty = $Winnipeg->honeyPotIsEmpty($fieldId);

if(!$isHoneyPotEmpty){
$data = $Winnipeg->getLocalLogs(); 
# or check your own logger, if one was set
}

贡献

当然可以!您可以查看 CONTRIBUTING

许可证

本项目受 MIT 许可证的约束;有关详细信息,请参阅 LICENSE