pierrerolland / hipchat-bundle
Hipchat 在 Symfony 应用程序中的集成
v1.0.0
2016-06-22 14:04 UTC
Requires
- php: >=5.4.0
- pierrerolland/guzzle-config-operations-bundle: ^1.0
- symfony/framework-bundle: >=2.6
This package is auto-updated.
Last update: 2024-09-18 01:26:24 UTC
README
Hipchat 在 Symfony 应用程序中的集成。此包允许您向配置中定义的 Hipchat 房间发送通知。
安装
composer require pierrerolland/hipchat-bundle
并在您的 app/AppKernel.php 中
class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new JMS\SerializerBundle\JMSSerializerBundle(), new Guzzle\ConfigOperationsBundle\GuzzleConfigOperationsBundle(), new Atlassian\HipchatBundle\AtlassianHipchatBundle(), ]; return $bundles; }
使用方法
1. 获取您的房间令牌
在浏览器的 Hipchat 版本中,转到“集成”,然后选择“构建自己的”。选择一个房间并为您的集成命名。现在您将获得一个房间 ID 和一个认证令牌。
2. 在 Symfony 中配置房间
# config.yml atlassian_hipchat: group: "plop" # Your group's name (plop.hipchat.com) rooms: foo: id: 42 # The room "foo"'s id token: blahblahblah # The room "foo"'s auth token ...
3. 发送您的通知
$this ->get('atlassian_hipchat.manager.hipchat') ->createNotification('foo', 'Will Grigg\'s on fire !', 'purple');
就是这样!