A wrapper around the HipChat PHP library, for accessing the HipChat REST API.
To install using composer, add the following to your composer.json:
{
"require": {
"mannew/hipchat-bundle": "*"
}
}
Enable the bundle by adding it to the application kernel.
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Mannew\HipchatBundle\MannewHipchatBundle(),
);
} ?>
Update your config.yml to contain the a section for this bundle.
mannew_hipchat:
auth_token: YOUR_HIPCHAT_AUTH_TOKEN_HERE
verify_ssl: true # optional
proxy_address: ~ # optional
request_timeout: 15 # in seconds, optional
The bundle provides the DIC with a service named hipchat. To access this service you can use:
<?php
$hipChat = $this->container->get('hipchat');
The bundle also provides the following commands:
# send messages from the command
$ app/console hipchat:send:message --room='Room name' 'Message content' 'Sender name' --color=red
# set the room topic
$ app/console hipchat:set:room:topic 'Room name' 'new topic' 'Sender name'
The service is an instance of the HipChat\HipChat class from the HipChat PHP library.