2017 © Pedro Peláez
 

library php-openfire-restapi

Manage Open fire server using Rest Api

image

maniaplanet/php-openfire-restapi

Manage Open fire server using Rest Api

  • Friday, May 19, 2017
  • by magnetik
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,725 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 37 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

php-openfire-restapi

A simple PHP class designed to work with Openfire Rest Api plugin. It is used to remote manage the Openfire server. Originally forked from gidkom/php-openfire-restapi., (*1)

LICENSE

php-openfire-restapi is licensed under MIT style license, see LICENCE for further information., (*2)

REQUIREMENTS

  • PHP 5.4+

INSTALLATION

### With Composer

The easiest way to install is via composer. Create the following composer.json file and run the composer.phar install command to install it., (*3)

{
    "require": {
        "maniaplanet/php-openfire-restapi": "v1.x"
    }
}

USAGE

Initialisation

include "vendor/autoload.php";

// Create the Openfire Rest api object
$api = new Maniaplanet\OpenFireRestApi\OpenFireRestApi;

// Set the required config parameters
$api->secret = "MySecret";
$api->host = "jabber.myserver.com";
$api->port = "9090";  // default 9090

// Optional parameters (showing default values)

$api->useSSL = false;
$api->plugin = "/plugins/restapi/v1";  // plugin 

Adding a new user

// Add a new user to OpenFire and add to a group
$newUser = new Maniaplanet\OpenFireRestApi\Entity\;
$newUser->username  = 'Username';
$newUser->password  = 'Password';
$newUser->name      = 'Real Name';
$newUser->email     = 'johndoe@domain.com';
$newUser->groups    =  array('Group 1');

$result = $api->createUser($newUser);

// Check result if command is succesful
if($result['status']) {
    echo 'Success: ';
} else {
    // Something went wrong, probably connection issues
    echo 'Error: ';
    echo $result['error'];
}

The Versions

19/05 2017

dev-master

9999999-dev https://github.com/maniaplanet/php-openfire-restapi

Manage Open fire server using Rest Api

  Sources   Download

MIT

The Requires

 

by Gideon Kombian
by Sylvain Guglielmi

xmpp chat openfire