esendex/sdk 问题修复 & 功能扩展

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

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

esendex/sdk

Composer 安装命令:

composer require esendex/sdk

包简介

Send SMS from your application using the Esendex API

README 文档

README

Build Status Latest Stable Version Latest Unstable Version License

Installation

Requirements

  • PHP >= 8.3
  • ext-curl enabled

The esendex-php-sdk is available to install through several methods as well as from source.

Composer

{
    "require": {
        "esendex/sdk": "3.*.*"
    }
}

Composer is not included within the repository, so you will need to retrieve it using the following command:

curl -sS https://getcomposer.org/installer | php

For installation on other platforms see getcomposer.org

We're in the default Packagist repository so just run

$ php composer.phar require esendex/sdk:3.*.*

or add the package above to your composer.json

Then just include Composer's generated autoload.php somewhere in your code;

require_once 'path/to/vendor/autoload.php';

GZIP

Download the current version here

Our autoloader may be included somewhere in your application;

require_once 'path/to/downloaded/sdk/src/Esendex/AutoLoad.php';

Getting Started

Sending SMS

$message = new \Esendex\Model\DispatchMessage(
    "WebApp", // Send from
    "01234567890", // Send to any valid number
    "My Web App is SMS enabled!",
    \Esendex\Model\Message::SmsType
);
$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex Account Reference
    "user@example.com", // Your login email address
    "password" // Your password
);
$service = new \Esendex\DispatchService($authentication);
$result = $service->send($message);

print $result->id();
print $result->uri();

Retrieving Inbox Messages

$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex Account Reference
    "user@example.com", // Your login email address
    "password" // Your password
);
$service = new \Esendex\InboxService($authentication);

$result = $service->latest();

print "Total Inbox Messages: {$result->totalCount()}";
print "Fetched: {$result->count()}";
foreach ($result as $message) {
    print "Message from: {$message->originator()}, {$message->summary()}";
}

Track Message Status

$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex account reference
    "user@example.com", // Your login email
    "password" // Your password
);
$headerService = new \Esendex\MessageHeaderService($authentication);
$message = $headerService->message("messageId");
print_r($message->status());

Retrieving Full Message Body

$messageId = "unique-id-of-message";
$authentication = new \Esendex\Authentication\LoginAuthentication(
    "EX000000", // Your Esendex Account Reference
    "user@example.com", // Your login email address
    "password" // Your password
);
$service = new \Esendex\MessageBodyService($authentication);

$result = $service->getMessageBodyById($messageId);

print $result;

Would you like to know more?

Full REST API documentation can be found @ developers.esendex.com

Testing

Unit Tests

You will need to install composer in order to acquire the pre-requisites. This can be achieved by the following command:

$ curl -sS https://getcomposer.org/installer | php

To retrieve said pre-requisites execute the following:

$ composer.phar install

A suite of tests can be found in the test directory. To run them use the phing build utility. e.g.

$ php vendor/bin/phing

Credentials Test

You can check your account credentials using a phing task we have provided. First, ensure dependencies have been installed with composer:

$ composer.phar install

Run the check-access script:

$ vendor/bin/phing check-access
Buildfile: /home/developer/esendex-php-sdk/build.xml

EsendexSDK > check-access:

Esendex Username ? user@example.com
Esendex Password ? secret
Account Reference? EX000000

    Account credentials OK!

BUILD FINISHED

Total time: 10.0000 seconds

Issues

We hope you don't run into any issues but if you should please make use of the issue tracker on github or send an email to support@esendex.com

Feedback

Let us know what you think @esendex

esendex/sdk 适用场景与选型建议

esendex/sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 980.33k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2013 年 03 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「rest」 「api」 「sms」 「restful」 「requests」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 esendex/sdk 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 980.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 17
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 48
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-03-08