khelchy/argus-php

这是 ARGUS 引擎的官方 PHP 库,该库帮助 PHP 开发者和应用程序无缝集成到 ARGUS 引擎,实现认证和事件监听。

v1.0.1 2024-03-23 12:16 UTC

This package is auto-updated.

Last update: 2024-09-23 13:31:49 UTC


README

这是 ARGUS 引擎 的官方 PHP 库,该库帮助 PHP 开发者和应用程序无缝集成到 ARGUS 引擎,实现认证和事件监听。

通过 Composer 安装

    composer require khelechy/argus-php

使用说明 -

   <?php

   use Khelechy\Argus\Argus;

定义一个类,当收到 Argus 事件时调用该类中的函数

    <?php

    class TestSub{

        public function subscribeToArgus($argusData){
            echo $argusData->Action . "\n";
            echo $argusData->ActionDescription . "\n";
            echo $argusData->Name . "\n";
            echo $argusData->Timestamp . "\n";
        }
    }

最后可以这样使用 argus

    $sub = new TestSub();

    $argus = new Argus("testuser", "testpassword"); // Optionally you can pass the host and port, and auth credentials inclusive.

    $argus->subscribe($sub, 'subscribeToArgus');

    $argus->connect();