Download the PHP package minchao/mitake-php without Composer

On this page you can find all versions of the php package minchao/mitake-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mitake-php

mitake-php

Continuous Integration Codacy Badge codecov Latest Stable Version Latest Unstable Version composer.lock

mitake-php 是三竹簡訊 SMS HTTP API 的非官方 PHP Client SDK(僅支援台灣行動電話號碼),使用這個 SDK 前, 請確認您已申請三竹簡訊 HTTP Function Call 功能,若您想在 Laravel 下使用,請參考 mitake-laravel 提供的 Service provider

執行環境

安裝

推薦使用 Composer 安裝 mitake-php

使用

Mitake client

實例化 Mitake client,USERNAME 與 PASSWORD 請分別填入您申請的三竹簡訊帳號與密碼

範例

呼叫 Mitake API

查詢帳戶餘額

查詢目前的帳戶剩餘點數

發送單筆簡訊

發送簡訊前,請先透過 Message 類別建立簡訊內容,再呼叫 API 的 send() 方法發送

發送多筆簡訊

若要一次發送多筆簡訊,請先建立欲發送的 Message objects 陣列,再呼叫 API 的 sendBatch() 方法發送

發送單筆長簡訊

發送長簡訊前,請先透過 LongMessage 類別建立簡訊內容,再呼叫 API 的 sendLongMessage() 方法發送

發送多筆長簡訊

若要一次發送多筆長簡訊,請先建立欲發送的 LongMessage objects 陣列,再呼叫 API 的 sendLongMessageBatch() 方法發送

查詢簡訊發送狀態

查詢時請帶入簡訊發送後返回的 msgid

取消預約發送簡訊

取消時請帶入簡訊 msgid

使用 webhook 接收傳送狀態

發送簡訊時若有設定 response 網址,簡訊伺服器就會在發送狀態更新時以 HTTP GET 方法通知指定的 response 網址, 您可參考 webhook 中的範例來接收簡訊傳送狀態

簡訊設定 response 網址:

建立 webhook:

開發

開發工具

本專案提供 Command Line Developer Tools,供您在開發時作為測試工具使用

指令:

使用範例如下:

使用 Docker Compose 啟動 webhook 服務

請設定環境變數 VIRTUAL_HOST、LETSENCRYPT_HOST 與 LETSENCRYPT_EMAIL,Docker Compose 會在本機的 443 Port 上啟動 webhook 服務, 並自動透過 Let's Encrypt 建立 SSL 憑證

Command:

Logs:

執行測試

執行 phpcs 與 phpunit 測試

FAQ

Q:遇到 PHP Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 35

A:這是因為 OpenSSL 已不支援 TLS 1.1 以下版本,建議使用長簡訊方法來傳送簡訊,請參考 Issue #4 的說明。

注意:使用 HTTP 或已棄用的 TLS 協議來傳送簡訊,會將傳輸資料暴露外洩的風險之中。

License

See the LICENSE file for license rights and limitations (MIT).


All versions of mitake-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package minchao/mitake-php contains the following files

Loading the files please wait ....