Download the PHP package chao/l5-alidayu-tts without Composer

On this page you can find all versions of the php package chao/l5-alidayu-tts. 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 l5-alidayu-tts

阿里大于文本转语音通知 Laravel5支持库

# 安装和配置

1、使用Composer进行安装,在您工程目录下执行

2、增加Service Provider

请将以下代码增加到您的config/app.php文件的providers数组中。

完成后您的代码将类似下面:

3、配置

请先执行以下命令生成配置文件:

该命令将会把tts.php配置文件增加到您的配置文件目录config下。

修改项目环境变量增加阿里大于密钥配置。修改您的.env文件,并增加以下两个变量:

注意:ALIDAYU_TTS_FAKE设置为true的时候,程序将模拟发送文本转语音通知(不调用阿里大于),并一律返回发送成功的消息体。该功能主要用于集成测试。在测试环境下设置为true可有效避免程序员半夜被骚扰。

以上配置文件请从阿里大于网站获得。


开始使用

1、程序调用

在您需要调用语音通知的控制器中引用本函数库。

在需要调用的函数中:

call方法一共调用了4个参数。含义如下:

名称 类型 是否必须 示例 说明
$calledNum 字符串 必须 13700000000 被叫号码,支持国内手机号与固话号码,格式如下:057188773344,13911112222,4001112222,95500
$calledShowNum 字符串 必须 4001112222 被叫号显,传入的显示号码必须是阿里大于“管理中心-号码管理”中申请或购买的号码
$ttsCode 字符串 必须 TTS_10001 TTS模板ID,传入的模板必须是在阿里大于“管理中心-语音TTS模板管理”中的可用模板
$ttsParam 数组 可选 ['key' => 'val'] 文本转语音(TTS)模板变量,传参规则array('key' => 'value'),其中key的名字须和TTS模板中的变量名一致

注意: $ttsParam中的数组应为一维数组,并且元素的值仅支持字符串类型。

参数具体使用请参见阿里大于API文档

返回执行发送的结果

发送成功后程序将会返回以下对象(示例):

调用失败将返回以下对象(示例):

详细返回结果请查询阿里大于API及相关文档。

鸣谢

本项目参考了AliSMS - For Laravel5代码。鸣谢 秋綾 ([email protected])所提供的短信部分功能。

作者

周超 [email protected]


All versions of l5-alidayu-tts with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
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 chao/l5-alidayu-tts contains the following files

Loading the files please wait ....