mannew/hipchat-bundle

一个用于集成HipChat PHP库以访问其REST API的捆绑包。

1.4 2015-12-08 14:05 UTC

This package is auto-updated.

Last update: 2024-09-12 01:55:21 UTC


README

Build Status

一个围绕HipChat PHP库的包装器,用于访问HipChat REST API。

安装

使用composer下载

要使用composer安装,请将以下内容添加到您的composer.json文件中

{
    "require": {
        "mannew/hipchat-bundle": "*"
    }
}

启用捆绑包

通过将其添加到应用程序内核中启用捆绑包。

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Mannew\HipchatBundle\MannewHipchatBundle(),
    );
} ?>

配置捆绑包

更新您的config.yml以包含此捆绑包的节。

mannew_hipchat:
	auth_token: YOUR_HIPCHAT_AUTH_TOKEN_HERE
	verify_ssl: true    # optional
	proxy_address: ~    # optional
	request_timeout: 15 # in seconds, optional

用法

此捆绑包向DIC提供了一个名为hipchat的服务。要访问此服务,您可以使用

<?php

$hipChat = $this->container->get('hipchat');

此捆绑包还提供了以下命令

# 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'

进一步阅读

此服务是来自HipChat PHP库的HipChat\HipChat类的实例。