fortresswire/fw-sdk-php

FortressWire SDK for PHP - Use FortressWire in your PHP project

dev-main 2021-05-29 16:28 UTC

This package is not auto-updated.

Last update: 2024-04-27 05:11:30 UTC


README

Disclaimer: This is a wip

The FortressWire SDK for PHP makes it easy for developers to interact with FortressWre from their PHP code. You can get started by installing the SDK through Composer.

Getting Started

  1. Minimum requirements - To run the SDK, your system will need to have a minimum PHP version of 7.4 with the cURL extension.

  2. Install the SDK - Using Composer is the recommended way to install the FortressWire SDK for PHP. The SDK is available via Packagist under the fortresswire/fw-sdk-php package. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency:

composer require fortresswire/fw-sdk-php

Quick Examples

Creating a Watchdog client

require './vendor/autoload.php';

use FortressWire\Watchdog\WatchdogClient;

$client = new WatchdogClient([
    'version' => '1',
    'region' => 'af-south-1',
    'key' => $_ENV['WATCHDOG_KEY'],
]);

Creating Watchdog events

...

use FortressWire\Watchdog\WatchdogEvents;

$logger = new WatchdogEvents($client);

$logger->create('debug - low', 'Account registration failed.', [
    'first_name' => 'Donald',
    'last_name' => 'Pakkies'
]);

Creating a MoanaDB client

require './vendor/autoload.php';

use FortressWire\Moana\MoanaClient;

$client = new MoanaClient([
    'version' => '1',
    'region' => 'af-south-1',
    'key' => $_ENV['MOANA_KEY'],
]);

Creating a MoanaDB record

...

use FortressWire\Moana\Document;

$document = new Document($client);

$document->table('users')->create([
    'first_name' => 'Donald',
    'last_name' => 'Pakkies',
]);

License

The MIT License (MIT). Please see License File for more information.