abuseio/findcontact-custom

AbuseIO 模块,用于自定义查找后端系统。

1.1.2 2016-04-13 14:44 UTC

This package is auto-updated.

Last update: 2024-09-23 06:12:46 UTC


README

用于自定义查找后端系统的 findcontact 模块

安装

  1. 在您的 AbuseIO 安装文件夹中运行此命令以安装包
composer require abuseio/findcontact-custom

与 API 通信

如果您要与 API 通信,请将 examples/template 目录中的 php 文件复制到 srcconfig 目录中(在 AbuseIO 安装文件夹内)

cp vendor/abuseio/findcontact-custom/examples/template/config/Custom.php vendor/abuseio/findcontact-custom/config/
cp vendor/abuseio/findcontact-custom/examples/template/src/Custom.php vendor/abuseio/findcontact-custom/src/

现在删除示例文件夹

rm -r vendor/abuseio/findcontact-custom/examples

您现在可以在 'getContactBy*' 方法中编写自己的代码。

与数据库通信

如果您要直接与数据库通信,请将 examples/postgres 目录中的 php 文件复制到 srcconfig 目录中(在 AbuseIO 安装文件夹内)

cp vendor/abuseio/findcontact-custom/examples/postgres/config/Custom.php vendor/abuseio/findcontact-custom/config/
cp vendor/abuseio/findcontact-custom/examples/postgres/src/Custom.php vendor/abuseio/findcontact-custom/src/
cp vendor/abuseio/findcontact-custom/examples/postgres/src/CustomServiceProvider.php vendor/abuseio/findcontact-custom/src/

现在删除示例文件夹

rm -r vendor/abuseio/findcontact-custom/examples

在文件 config/app.php 的 providers 数组中添加以下行

'AbuseIO\FindContact\Custom\CustomServiceProvider'

您现在可以在 'getContactBy*' 方法中编写自己的代码。

有关在数据库中设置外键的信息,请参阅 Models/Ip4.php