定制 websms-com/websmscom-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

websms-com/websmscom-php

Composer 安装命令:

composer require websms-com/websmscom-php

包简介

A lightweight PHP-client-library for using websms.com SMS services.

README 文档

README

              W E B S M S . C O M   P H P  T O O L K I T 

What is it?

A lightweight PHP-client-library for using websms.com SMS services. Reduces the complexity of network-communication between client and SMS gateway, to help business-customer save time and money for focusing on their business logic.

Installation

Include WebSmsCom_Toolkit.inc into your PHP File in order to access the classes and methods for sending text and binary SMS.

   // will need JSON.phps (Service_JSON) for PHP<5.2.0
   include "WebSmsCom_Toolkit.inc";`

For PHP versions lower than 5.2.0 please make sure that JSON.phps is in the same directory as WebSmsCom_Toolkit.inc or install Services_JSON from PEAR.

or install with Composer

   composer require websms-com/websmscom-php

Example

See send_sms.php on how to send messages

  1. Create sms client (once)

    $smsClient = new WebSmsCom_Client($username, $pass, $gateway_url);

  2. Create message

    $message = new WebSmsCom_TextMessage($recipientAddressList, $utf8_message_text);

  3. Send message

    $Response = $smsClient->send($message, $maxSmsPerMessage, $test);

Documentation

The documentation available as of the date of this release is included in send_sms.php and WebSmsCom_Toolkit.inc.

FAQ

Question: Why do I get a CURLOPT_SSL_VERIFYHOST error?

 `curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead` 

Answer: Just set $smsClient->setSslVerifyHost(2)

   // 1.) -- create sms client (once) ------
   $smsClient = new WebSmsCom_Client($username, $pass, $gateway_url);
   $smsClient->setSslVerifyHost(2);

Changelog

  • Version 1.0.10: Added SmsCount property to WebSmsCom_Response (thanks to AlexHoebart-ICPDR)
  • Version 1.0.9: Tested functionality with PHP 8.4.3; Fixes missing class property causing deprecation note on dynamic property.
  • Version 1.0.8: Tested functionality with PHP 8.0.5, removes deprecated and unnecessary defaultValue for $pass argument in WebSmsCom_Client constructor
  • Version 1.0.7: Restored compatibility to PHP 5.0.3+ (removes PHP7 style scalar type hinting)
  • Version 1.0.6: Access token support
  • Version 1.0.5: Composer / Packagist support
  • Version 1.0.4: Throws WebSmsCom_ParameterValidationException on json_encode() errors to prevent body being 'null' or 'false'. Before this change an empty content body resulted in an API exception with status code 4120
  • Version 1.0.3: Fixed setter setHttpClient and setSenderAddressType
  • Version 1.0.2: Fixed error where long message content could not be sent because some curl/php versions set "Expect:" HTTP Header.
  • Version 1.0.1: Fixed setter setMessageContent()
  • Version 1.0.0: Basic text- and binary-sms-sending.

Contact

For any further questions into detail the contact-email is developer@websms.com

websms-com/websmscom-php 适用场景与选型建议

websms-com/websmscom-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 77.07k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 04 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 websms-com/websmscom-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 websms-com/websmscom-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 websms-com/websmscom-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-24