Download the PHP package wechat-app/session-bundle without Composer

On this page you can find all versions of the php package wechat-app/session-bundle. 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 session-bundle

WechatAppSessionBundle

⚠️⚠️由于项目是小程序正式公测时编写,现已不适用于生产环境的项目⚠️⚠️

WechatAppSessionBundle 是一个用于处理微信小程序的 Symfony Bundle,实现思路参照了腾讯云官方-微信小程序云端解决方案中的 会话管理场景,即这个 Bundle 是其 PHP(Symfony) 版本的一种实现。(只是不知道有多少使用 Symfony 的童鞋😂)

微信的定位并不是 HTML5,这里很多人都有误解。在一些实现上,并不能想当然地用 HTML5 的思路来思考。比如,微信的请求接口 wx.request 并不支持 cookie 传递,所以会话层不能使用传统的 Session 方式。 ——腾讯云官方的微信小程序云端解决方案

该 Bundle 包含的功能:

安装和配置

第一步:使用 composer 安装 Bundle

第二步:启用 Bundle

第三步:配置依赖 Bundle

相关依赖的深入配置,请参考其对应的文档。

第四步:配置

第五步:使用

在安装和配置完成之后,Bundle 的功能马上就可以投入使用了,该 Bundle 只会对实现了 WechatApp/SessionBundle/Controller/SessionAuthController 接口的控制器生效,对其他不是用于处理小程序请求的接口不会有影响。

处理流程请参照腾讯云提供的官方文档

下面举个例子:

访问上面 action 对应的路由,将返回一个包含用户信息 json,大致是:

此时登入到 Redis 中:

以上两个 key 都设置了过期时间,默认为7200秒。

以上是后端接口部分的使用,小程序端的部分相对来说比较简单。

该 Bundle 暂时没有提供小程序端的部分,小程序端的实现可以参考上面的说明去自行实现,或借鉴腾讯云官方提供的一个实现方式,记住,是借鉴而不是照搬,因为这个 Bundle 并非是为了搭配腾讯云提供的实现方案的,另外要注意的是,其小程序端的实现方式只实现了 wx.request 接口的包装,而关于文件上传、WebSocket 的实现都还没有包装,使用时还是需要考虑自己完善其他请求的包装。


All versions of session-bundle with dependencies

PHP Build Version
Package Version
Requires sensio/buzz-bundle Version ^1.1
snc/redis-bundle Version ^2.0
predis/predis Version ^1.1
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 wechat-app/session-bundle contains the following files

Loading the files please wait ....