ismaeltoe/osms
Composer 安装命令:
composer require ismaeltoe/osms
包简介
PHP library wrapper of the Orange SMS API.
README 文档
README
A PHP library to access Orange SMS API.
Current version: 2.0.2
Installation
With Composer (recommended)
Install Composer. Then, do:
$ composer require ismaeltoe/osms
Without Composer
Simply download the latest release.
Loading
You can load the class using Composer's autoloading:
require 'vendor/autoload.php';
Otherwise, you can simply require the file directly:
require 'path/to/Osms.php';
Quick Start
Case 1: You have no access token
require 'vendor/autoload.php'; use \Osms\Osms; $config = array( 'clientId' => 'your_client_id', 'clientSecret' => 'your_client_secret' ); $osms = new Osms($config); // retrieve an access token $response = $osms->getTokenFromConsumerKey(); if (!empty($response['access_token'])) { $senderAddress = 'tel:+2250000'; $receiverAddress = 'tel:+22500000000'; $message = 'Hello World!'; $senderName = 'Optimus Prime'; $osms->sendSMS($senderAddress, $receiverAddress, $message, $senderName); } else { // error }
Case 2: You have an access token
require 'vendor/autoload.php'; use \Osms\Osms; $config = array( 'token' => 'your_access_token' ); $osms = new Osms($config); $senderAddress = 'tel:+2250000'; $receiverAddress = 'tel:+22500000000'; $message = 'Hello World!'; $senderName = 'Optimus Prime'; $osms->sendSMS($senderAddress, $receiverAddress, $message, $senderName);
Check out examples for more examples.
CHECK OUT also Osms.php to see all the methods available. But DON'T MODIFY IT. You can extend the class to add your own stuff.
Country Sender Number
The sender address is a unique country sender number per country. You can find the list of country sender numbers here.
SSL certificate problem
If you get an SSL error, set the peer's certificate checking option to false:
$osms = new Osms(); $osms->setVerifyPeerSSL(false);
But it should work on your hosting server, so enable the certificate checking when you are ready to deploy your application for security reasons.
Documentation
Other Libraries
License
Released under the MIT License - see LICENSE.txt for details.
ismaeltoe/osms 适用场景与选型建议
ismaeltoe/osms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 40.7k 次下载、GitHub Stars 达 45, 最近一次更新时间为 2015 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「curl」 「json」 「rest」 「http client」 「api」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ismaeltoe/osms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ismaeltoe/osms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ismaeltoe/osms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
Simple cURL wrapper
Kinikit - PHP Application development framework MVC component
ext-json wrapper with sane defaults
A package to cast json fields, each sub-keys is castable
A fluent PHP CURL wrapper
统计信息
- 总下载量: 40.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 46
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-10