PHPackages                             deng-tp5/alisms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. deng-tp5/alisms

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

deng-tp5/alisms
===============

alisms-sendSms1.5.12

011PHP

Since Aug 17Pushed 6y agoCompare

[ Source](https://github.com/qq1415551519/php-composer-tp5-alisms)[ Packagist](https://packagist.org/packages/deng-tp5/alisms)[ RSS](/packages/deng-tp5-alisms/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

php-composer-tp5-alisms
=======================

[](#php-composer-tp5-alisms)

php-composer-tp5-alisms English | [简体中文](/README-zh-CN.md)

[![](https://camo.githubusercontent.com/ca39579bcc45443c3d23b19002c51ce56df19303955fd14f99de94538786ad98/68747470733a2f2f616c6979756e73646b2d70616765732e616c6963646e2e636f6d2f69636f6e732f416c6962616261436c6f75642e737667)](https://camo.githubusercontent.com/ca39579bcc45443c3d23b19002c51ce56df19303955fd14f99de94538786ad98/68747470733a2f2f616c6979756e73646b2d70616765732e616c6963646e2e636f6d2f69636f6e732f416c6962616261436c6f75642e737667)

Alibaba Cloud Client for PHP
============================

[](#alibaba-cloud-client-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/e707580fb2e1851f05eb8bc55e53bddbbbfcae2542d92a2427f37f3273517f20/68747470733a2f2f706f7365722e707567782e6f72672f616c6962616261636c6f75642f636c69656e742f762f737461626c65)](https://packagist.org/packages/alibabacloud/client)[![Latest Unstable Version](https://camo.githubusercontent.com/b540411074dc75759481422dd34cb50710423ce922db2b9b26d22805cf4e2610/68747470733a2f2f706f7365722e707567782e6f72672f616c6962616261636c6f75642f636c69656e742f762f756e737461626c65)](https://packagist.org/packages/alibabacloud/client)[![composer.lock](https://camo.githubusercontent.com/32d9a95528de48fff11a9437f031324b85374a54983ced087e3151d02e1592a2/68747470733a2f2f706f7365722e707567782e6f72672f616c6962616261636c6f75642f636c69656e742f636f6d706f7365726c6f636b)](https://packagist.org/packages/alibabacloud/client)[![Total Downloads](https://camo.githubusercontent.com/cc1144e00a3af90977102f40011a2b3731afadb408c51dd9255e442b0e10c0a1/68747470733a2f2f706f7365722e707567782e6f72672f616c6962616261636c6f75642f636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/alibabacloud/client)[![License](https://camo.githubusercontent.com/afa294e24ecf28c37b8c5e255ecd54787bd8cf8ea4d2eb28ed303b89b1fb21a6/68747470733a2f2f706f7365722e707567782e6f72672f616c6962616261636c6f75642f636c69656e742f6c6963656e7365)](https://packagist.org/packages/alibabacloud/client)
[![codecov](https://camo.githubusercontent.com/1abb2c95bff2c2cf26b98a119e90628073636f2604c8dbc44bfc47995acd1545/68747470733a2f2f636f6465636f762e696f2f67682f616c6979756e2f6f70656e6170692d73646b2d7068702d636c69656e742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/aliyun/openapi-sdk-php-client)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d608bc10ad942d9d03e96e4fd214e9e772f5fbe1ed3cb7370ec955053188cbbe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6979756e2f6f70656e6170692d73646b2d7068702d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/aliyun/openapi-sdk-php-client)[![Travis Build Status](https://camo.githubusercontent.com/448b1a9446a7c81c84971d7777aead7428701253cd110d498da02382965d1a21/68747470733a2f2f7472617669732d63692e6f72672f616c6979756e2f6f70656e6170692d73646b2d7068702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aliyun/openapi-sdk-php-client)[![Appveyor Build Status](https://camo.githubusercontent.com/b73c1a166fbf3dc45b3f352bf47bb5baa9718c15f5f9469642b46a5c293a2d5b/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f36393976303833776f7468376d6a38352f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/aliyun/openapi-sdk-php-client/branch/master)[![Code Intelligence Status](https://camo.githubusercontent.com/9c51671b973b3ef6eda2d7158964a9b44cbacc1a26254e1011285215b6cd9ef3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6979756e2f6f70656e6170692d73646b2d7068702d636c69656e742f6261646765732f636f64652d696e74656c6c6967656e63652e737667)](https://scrutinizer-ci.com/code-intelligence)

Alibaba Cloud Client for PHP is a client tool that helps PHP developers manage credentials and send requests, [Alibaba Cloud SDK for PHP](https://github.com/aliyun/openapi-sdk-php) dependency on this tool.

ThinkPhp5.1
===========

[](#thinkphp51)

1. application/common.php文件
---------------------------

[](#1---applicationcommonphp文件)

```
/**
 * 发送验证码公共方法
 * @param $mobile
 * @param $code
 * @return array
 * @throws ClientException
 * @author deng    (2019/8/17 10:55)
 */
function sendSms($mobile, $code)
{
    $condition = [
        'accessKeyId' => config('sms.accessKeyId'),
        'accessSecret' => config('sms.accessSecret'),
        'code' => $code,
        'mobile' => $mobile,
        'signName' => config('sms.signName'),
        'templateCode' => config('sms.templateCode'),
    ];
    $sendSms = AliSms::sendSms($condition);

    return $sendSms;
}
```

2. config/sms.php
-----------------

[](#2---configsmsphp)

```
// +----------------------------------------------------------------------
// | 短信设置
// +----------------------------------------------------------------------
return [
    'accessKeyId' => 'LTAIepxxx5VaFvt',
    'accessSecret' => 'WHqEyofsxxxxxxxMHT26hmqDRrqQQEn',
    'signName' => '模板名称',
    'templateCode' => '模板号码'
];
```

Online Demo
-----------

[](#online-demo)

[API Explorer](https://api.aliyun.com) provides the ability to call the cloud product OpenAPI online, and dynamically generate SDK Example code and quick retrieval interface, which can significantly reduce the difficulty of using the cloud API.

Prerequisites
-------------

[](#prerequisites)

Your system will need to meet the [Prerequisites](/docs/en-US/0-Prerequisites.md), including having PHP &gt;= 5.5. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+.

Installation
------------

[](#installation)

If Composer is already [installed globally on your system](https://getcomposer.org/doc/00-intro.md#globally), run the following in the base directory of your project to install Alibaba Cloud Client for PHP as a dependency:

```
composer require alibabacloud/client

```

> Some users may not be able to install due to network problems, you can try to switch the Composer mirror.

Please see the [Installation](/docs/en-US/1-Installation.md) for more detailed information about installing the Alibaba Cloud Client for PHP through Composer and other means.

Quick Examples
--------------

[](#quick-examples)

Before you begin, you need to sign up for an Alibaba Cloud account and retrieve your [Credentials](https://usercenter.console.aliyun.com/#/manage/ak).

### Create Client

[](#create-client)

```
