fourlabs/plivo-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fourlabs/plivo-bundle

Composer 安装命令:

composer require fourlabs/plivo-bundle

包简介

Plivo Bundle for Symfony - Send and receive text messages

README 文档

README

StyleCI Total Downloads License

Installation

Install with composer

    $ composer require fourlabs/plivo-bundle eightpoints/guzzle-bundle

Add these bundles to app/AppKernel.php

<?php
    //...
    $bundles = [
        // ...
        // FLPlivoBundle depends on GuzzleBundle and MisdPhoneNumberBundle
        // Add them if they're not already present in your $bundles
        new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle(), 
        new Misd\PhoneNumberBundle\MisdPhoneNumberBundle(), 
        new FL\PlivoBundle\FLPlivoBundle(),    
    ];
            

Sample Configuration

app/config/config.yml

# Guzzle Configuration
eight_points_guzzle:
    clients:
        plivo: # configure plivo client
            base_url: 'https://api.plivo.com/v1/Account/%plivo_auth_id%/'
            headers:
                Accept: "application/json"
            options:
                auth:
                    - %plivo_auth_id% # user
                    - %plivo_auth_token% # password
                timeout: 30

# Plivo Configuration
fl_plivo:
  sms_incoming_class: AppBundle\Entity\SmsIncoming
  sms_outgoing_class: AppBundle\Entity\SmsOutgoing
  development_mode: true # if set to true, sms will not be sent - defaults to false

app/config/services.yml

guzzle.client.plivo:
  alias: eight_points_guzzle.client.plivo

app/config/routing.yml

fl_plivo:
    resource: "@FLPlivoBundle/Resources/config/routing.yml"
    prefix:   /

Suggested Implementation

  • Create an entity for your ORM/ODM (e.g. Doctrine) that extends \Plivo\Model\SmsIncoming
  • Create an entity that extends \Plivo\Model\SmsOutgoing
  • If you are using Doctrine, you can use the corresponding event listeners, by importing them.
# app/config/config.yml
imports:
    - { resource: "@FLPlivoBundle/Resources/config/event-listener/doctrine.yml"}
  • If you are using not using Doctrine, create your own event listeners and submit a pull request ;)
  • To receive SMS messages, follow the instructions from Plivo
  • Use the corresponding url for the route fl_plivo.post_message (If you imported the default routing file, without a prefix, this would be /api/v1.0/message)

License

PlivoBundle is licensed under the MIT license.

统计信息

  • 总下载量: 1.4k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固