Openfire Symfony Bundle
Bundle used to connect to Openfire REST API and perform common tasks., (*1)
Installation
By composer :, (*2)
"require": {
"jean553/symfony-openfire-bundle": "dev-master"
}
app/AppKernel.php :, (*3)
$bundles = array(
new jean553\OpenfireBundle\OpenfireBundle()
);
Use
app/config/config.yml :, (*4)
parameters:
openfire_service: "jean553\OpenfireBundle\Services\OpenfireService"
openfire:
url: 'http://my-openfire-server:9090/plugins/restapi/v1'
secret: 'abcdefghijklmnopqrst'
In controller :, (*5)
$service = $this->get('openfire.service');
$service->createUser('username', 'password');
$service->createChatRoom('chat_room_id','chat_room_name', 'username');
$userJid = $service->getJid('username');
Tests
app/config/config_test.yml :, (*6)
parameters:
openfire_service: "jean553\OpenfireBundle\Services\DummyOpenfireService"