stefanbraspenning / pushbullet-bundle
此包提供与Pushbullet API库的集成,允许您在Symfony项目中与Pushbullet API交互
dev-master
2015-06-14 16:32 UTC
Requires
- php: >=5.4
- ivkos/pushbullet: ^3.1
- symfony/dependency-injection: ~2.2
- symfony/http-kernel: ~2.2
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-28 18:37:03 UTC
README
安装
步骤 1) 获取包
composer require stefanbraspenning/pushbullet-bundle
步骤 2) 注册包
要开始使用此包,请将其注册到您的Kernel中。
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new SB\Bundle\PushbulletBundle\SBPushbulletBundle(), // ... ); }
步骤 3) 配置默认API令牌(可选)
如果您还没有API令牌,请点击此链接: https://www.pushbullet.com/account。它会带您进入Pushbullet网站(如果您已登录,请向下滚动),让您为您的账户生成一个API令牌。
此包通过允许您预先定义要使用的API令牌,试图让将有效载荷发送到Pushbullet变得更容易。
注意:预先设置令牌不是必需的;您仍然可以选择留空配置,并在发送有效载荷时传递您选择的API令牌: $pb = new Pushbullet\Pushbullet('YOUR_ACCESS_TOKEN');
。
以下是一个示例
# app/config/config.yml sb_pushbullet: api_token: 1234 # replace with your own (see: https://www.pushbullet.com/account)
文档
有关如何访问每个API方法的详细文档,可以在此包集成的包的文档中找到: Pushbullet API库