PHPackages                             tuemmlerkon/php-openfire-restapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tuemmlerkon/php-openfire-restapi

ActiveLibrary[API Development](/categories/api)

tuemmlerkon/php-openfire-restapi
================================

Manage Open fire server using Rest Api

1.2.2(8y ago)022MITPHPPHP &gt;=5.4.0

Since Nov 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/TuemmlerKon/php-openfire-restapi)[ Packagist](https://packagist.org/packages/tuemmlerkon/php-openfire-restapi)[ Docs](https://github.com/tuemmlerkon/php-openfire-restapi)[ RSS](/packages/tuemmlerkon-php-openfire-restapi/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

php-openfire-restapi
====================

[](#php-openfire-restapi)

A simple PHP class designed to work with Openfire Rest Api plugin. It is used to remote manage the Openfire server.

LICENSE
-------

[](#license)

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

REQUIREMENTS
------------

[](#requirements)

- PHP 5.4+

INSTALLATION
------------

[](#installation)

### With Composer

[](#with-composer)

---

The easiest way to install is via [composer](http://getcomposer.org/). Create the following `composer.json` file and run the `composer.phar` install command to install it.

```
{
    "require": {
        "tuemmlerkon/php-openfire-restapi": "dev-master"
    }
}
```

USAGE
-----

[](#usage)

```
include "vendor/autoload.php";

//define your settings in an array (these are the default values) define only that ones you want to change
$settings = array(
    'host' 			=> 'localhost',
    'port' 			=> '9090',
    'plugin' 		=> '/plugins/restapi/v1',
    'secret' 		=> '',      //required when 'useBasicAuth' is set to false
    'useSSL' 		=> true,
    'useBasicAuth' 	=> false,   //if this option is set to true, you have also set 'basicUser' and 'basicPwd'
    'basicUser' 	=> '',
    'basicPwd' 		=> '',
);

// Create the Openfire Rest api object
$api = new TuemmlerKon\OpenFireRestApi\OpenFireRestApi($settings);
//You are also able to use getter ans setter methods on these settings
//e.g. $api->setEnableSSL(true);
```

For an easier handling of the returning values can use helper classes for `User` and `Group` returns.

After that you're able to use the following methods for accessing your OpenFire installation

```
/**
 * Get all registered users
 *
 * @return ArrayCollection|false Returns all users within an ArrayCollection in error case false
 */
public function getUsers();

/**
 * Get information for a specified user
 *
 * @param $username
 *
 * @return false|User ArrayCollection when there are results and false if there was an error
 */
public function getUser($username);

/**
 * Searches database for an specific user. Returns an ArrayCollection with one or more entries
 * on fault, method returns false
 *
 * @param $username
 *
 * @return bool|ArrayCollection
 */
public function searchUser($username);

/**
 * Creates a new user from an User object
 * you can create one, for example, by calling createUser(new User('username', 'password', 'fullName', 'email'))
 *
 * @param User $user
 *
 * @return bool
 */
public function createUser(User $user);

/**
 * Removes a user from OpenFire
 *
 * @param $username
 *
 * @return bool
 */
public function deleteUser($username);

/**
 * Updates an user on OpenFire
 *
 * Important: It's not possible to change the password on this way
 *
 * @param User $user
 *
 * @return bool
 */
public function updateUser(User $user);

/**
 * @param $username
 *
 * @return bool
 */
public function lockUserByUsername($username);

/**
 * @param $username
 *
 * @return bool
 */
public function unlockUserByUsername($username);

/**
 * locks/Disables an OpenFire user
 *
 * @param User $user
 *
 * @return bool
 */
public function lockUser(User $user);

/**
 * unlocks/Enables an OpenFire user
 *
 * @param User $user
 *
 * @return bool
 */
public function unlockUser(User $user);

/**
 * Retreives all associated groups for a user
 *
 * @param User $user
 *
 * @return bool|ArrayCollection
 */
public function getUserGroups(User $user);

/**
 * Returns all groups in an ArrayCollection or an empty collection if nothing was found
 * Returns false on error
 *
 * @return bool|ArrayCollection
 */
public function getGroups();

/**
 * Returns a specific group by Group object
 *
 * @param Group $group
 *
 * @return bool|Group
 */
public function getGroup(Group $group);

/**
 * Returns a specific group by groupname
 *
 * @param $groupname
 *
 * @return bool|Group
 */
public function getGroupByGroupname($groupname);

/**
 * Create a group by Group object
 *
 * @param Group $group
 *
 * @return bool
 */
public function createGroup(Group $group);

/**
 * Create a group by groupname
 *
 * @param string $groupname
 * @param string $description
 *
 * @return bool
 *
 */
public function createGroupByName($groupname, $description="");

/**
 * Delete a group by Group object
 *
 * @param Group $group
 *
 * @return bool
 */
public function deleteGroup(Group $group);

/**
 * Delete a group by Group object
 *
 * @param $groupname
 *
 * @return bool
 */
public function deleteGroupByName($groupname);

/**
 * @param Group $group
 *
 * @return bool
 */
public function updateGroup(Group $group);

/**
 * Update a group by Group name
 *
 * Note: Description is required here
 *
 * @param string $groupname
 * @param string $description
 *
 * @return bool
 */
public function updateGroupByName($groupname, $description);

/**
 * Adds Multiple groups to an specific user
 * @param User            $user
 * @param ArrayCollection $groups
 *
 * @return bool
 */
public function addUserToGroups(User $user, ArrayCollection $groups);

/**
 * Adds an user to an group by Group object
 *
 * @param User  $user
 * @param Group $group
 *
 * @return bool
 */
public function addUserToGroup(User $user, Group $group);

/**
 * Adds an user to an group by a given groupname
 *
 * @param User $user
 * @param string $groupname
 *
 * @return bool
 */
public function addUserToGroupByGroupName(User $user, $groupname);

/**
 * Removes multiple groups from an specific user
 * @param User            $user
 * @param ArrayCollection $groups
 *
 * @return bool
 */
public function removeUserFromGroups(User $user, ArrayCollection $groups);

/**
 * Adds an user to an group by Group object
 *
 * @param User  $user
 * @param Group $group
 *
 * @return bool
 */
public function removeUserFromGroup(User $user, Group $group);

/**
 * Adds an user to an group by a given groupname
 *
 * @param User $user
 * @param string $groupname
 *
 * @return bool
 */
removeUserFromGroupByGroupName(User $user, $groupname);
```

Development
-----------

[](#development)

Feel free to add new features or inform me about bugs or problems.

CONTACT
-------

[](#contact)

- Mail me at

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

3104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8bddd1512ac9889f5428c76ecc8f03026c6992fa1be6b049d962ab4eed87cfc?d=identicon)[TuemmlerKon](/maintainers/TuemmlerKon)

---

Top Contributors

[![gidkom](https://avatars.githubusercontent.com/u/4060499?v=4)](https://github.com/gidkom "gidkom (38 commits)")[![ottoszika](https://avatars.githubusercontent.com/u/7945963?v=4)](https://github.com/ottoszika "ottoszika (3 commits)")[![alfredog1976](https://avatars.githubusercontent.com/u/28766561?v=4)](https://github.com/alfredog1976 "alfredog1976 (1 commits)")[![tibo9](https://avatars.githubusercontent.com/u/5981057?v=4)](https://github.com/tibo9 "tibo9 (1 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![emamirazavi](https://avatars.githubusercontent.com/u/3804866?v=4)](https://github.com/emamirazavi "emamirazavi (1 commits)")

---

Tags

apichatxmppopenfireopenfire-api

### Embed Badge

![Health badge](/badges/tuemmlerkon-php-openfire-restapi/health.svg)

```
[![Health](https://phpackages.com/badges/tuemmlerkon-php-openfire-restapi/health.svg)](https://phpackages.com/packages/tuemmlerkon-php-openfire-restapi)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[gidkom/php-openfire-restapi

Manage Open fire server using Rest Api

56158.6k](/packages/gidkom-php-openfire-restapi)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)[gnello/php-openfire-restapi

Client for the REST API plugin of the OpenFire Server

3013.8k](/packages/gnello-php-openfire-restapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
