simperfit/twilio-bundle
Composer 安装命令:
composer require simperfit/twilio-bundle
包简介
A simple Symfony 2, 3 bundle for the official sdk provided by Twilio.
关键字:
README 文档
README
Symfony Twilio Bundle - by Fridolin Koch forked and update for Symfony 4.X by Hamza Amrouche
About
This is just a wrapper for the official SDK provided by Twilio.
Installation
Add this to your composer.json file:
"require": { "vresh/twilio-bundle": "dev-master", }
Add the bundle to app/AppKernel.php
$bundles = array( // ... other bundles new Vresh\TwilioBundle\VreshTwilioBundle(), );
Configuration
Add this to your config.yml:
vresh_twilio: #(Required) Your Account SID from www.twilio.com/user/account sid: 'XXXXXXXX' #(Required) Your Auth Token from www.twilio.com/user/account authToken: 'YYYYYYYY' #(Optional, default: '2010-04-01') Twilio API version version: '2010-04-01' #(Optional, default: 1) Number of times to retry failed requests retryAttempts: 3
Usage
Provided services:
| Service | Class |
|---|---|
twilio.api |
\Services_Twilio |
twilio.capability |
\Services_Twilio_Capability |
twilio.lookups |
\Lookups_Services_Twilio |
Inside a controller:
class TelephoneController extends Controller { public function callAction($me, $maybee) { //returns an instance of Vresh\TwilioBundle\Service\TwilioWrapper $twilio = $this->get('twilio.api'); $message = $twilio->account->messages->sendMessage( '+14085551234', // From a Twilio number in your account '+12125551234', // Text any number "Hello monkey!" ); //get an instance of \Service_Twilio $otherInstance = $twilio->createInstance('BBBB', 'CCCCC'); return new Response($message->sid); } }
Inside a console command:
class SomeCommand extends ContainerAwareCommand { protected function configure() { $this ->setName('some:comand') ->setDescription('A command') ; } protected function execute(InputInterface $input, OutputInterface $output) { //returns an instance of Vresh\TwilioBundle\Service\TwilioWrapper $twilio = $this->getContainer()->get('twilio.api'); $message = $twilio->account->messages->sendMessage( '+14085551234', // From a Twilio number in your account '+12125551234', // Text any number "Hello monkey!" ); //get an instance of \Service_Twilio $otherInstance = $twilio->createInstance('BBBB', 'CCCCC'); print $message->sid; } }
Copyright / License
See LICENSE
simperfit/twilio-bundle 适用场景与选型建议
simperfit/twilio-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 446.1k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「twilio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 simperfit/twilio-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 simperfit/twilio-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 simperfit/twilio-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Componente para integração com serviços de mensageria com APIs externas como Twilio, SendGrid, AWS SES, etc.
A Twilio SMS plugin for Yii2 based off my base package, Yii2 SMS, to make sending SMS messages as easy as emails!
Two-factor SMS authentication via Twilio Authy
Provides Twilio services in Laravel.
A simple Symfony bundle for Twilio API.
统计信息
- 总下载量: 446.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-27