scribe/clockwork-bundle

此包已被弃用,不再维护。未建议替代包。

Symfony扩展包,用于处理与clockworksms.com的交互以发送短信

v1.1.0 2014-02-26 20:19 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:31:46 UTC


README

Symfony扩展包,用于处理与clockworksms.com的交互以发送短信

需求

安装

将以下内容添加到composer.json文件中的require

"scribe/clockwork-bundle": "dev-master"

运行composer.phar update以下载新包(此命令还将更新任何过时的包)。

要在您的应用程序中注册此扩展包,您必须将扩展包添加到位于AppKernel.php文件中的$bundles数组。

new Scribe\ClockworkBundle\ScribeClockworkBundle()

配置

编辑您的symfony config.yml文件,并至少添加以下行

scribe_clockwork:
  api_key: your-api-key-goes-here

您还可以选择配置以下项目(显示默认值)

scribe_clockwork:
  api_key: your-api-key-goes-here
  allow_long_messages: false
  truncate_long_messages: true
  from_address: 'ScribeClock'
  enable_ssl: true
  invalid_character_action: replace_character
  log_activity: false

使用方法

假设您已完成安装和配置,您可以通过请求scribe.clockwork服务和使用send方法发送短信。

$cw = $container->get('scribe.clockwork');
$message_id = $cw->send('12223334444', 'Your text message goes here');

还有更复杂的使用方法,包括发送多条消息、检查余额、信用和API密钥的有效性。

许可证

请参阅随此软件一起分发的LICENSE文件。