Download the PHP package lspbupt/yii2-dingtalk without Composer

On this page you can find all versions of the php package lspbupt/yii2-dingtalk. 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 yii2-dingtalk

yii2-dingtalk

========================

yii2框架的钉钉API接口

本框架提供了对钉钉API接口的封装,具体的API页面访问钉钉API接口

For license information check the LICENSE-file. 在此处可以查看本扩展的许可

安装

推荐的方式是通过composer 进行下载安装composer

在命令行执行

或加入

到你的composer.json文件中的require段。

使用

钉钉配置

一旦你安装了这个插件,你就可以直接在yii2的配置文件中加入如下的代码:

后端接口访问

在配置好之后,你可以这么访问它:

后端接口返回

本接口将钉钉的返回进行了包装,无论任何情况(如网络超时,接口挂掉等),返回的结果均为json格式,且一定拥有errcode和errmsg字段,因此,使用方可以简单地根据errcode来判断接口的返回。

其它接口调用

由于钉钉的接口众多,因此想一一实现也是一件特别繁琐的事情,但是本扩展依旧提供了一个方便的方法来调用它:

app端Js调用

本插件依旧提供了JSAPI的一些封装,本例将会以app的免登的JS来举例子,在某页面上需要免登时,你只需要在页面上添加如下的代码:

按钉钉的说明做好使用code登录的后台接口,即可实现页面免登。

PC端Js调用

使用方式与上述app端一致,调用JsapiPcConfig即可,如下依旧以免登作为示例:

扫码登录

扫码登录不是使用dingtalk的一套规则,而是使用app的一套规则,首先去钉钉后台添加app,并配置好redirectUrl。然后在config中添加如下的配置:

然后在页面上按钉钉的规则,引入js,并展示二维码,当用户扫描时,回跳转到你的url,你在action中可以这样获取用户信息

消息回调

正常情况下,钉钉会有一些回调,这些回调需要在action中解密,过程很麻烦,本代码提供了一个便利的方式来使用。 在config中加入如下的配置:

在注册成功的回调的controller中加入如下的代码即可:

如上所示,你不需要关心钉钉是如何加解密的,也不需要关心他传过来的数据格式,系统会自动解密并将它传过来的xml转换成php的arr,直接在post()中取即可。

如有任何问题,欢迎联系我([email protected])。祝使用愉快!


All versions of yii2-dingtalk with dependencies

PHP Build Version
Package Version
Requires lspbupt/yii2-curl Version *
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 lspbupt/yii2-dingtalk contains the following files

Loading the files please wait ....