定制 wikimedia/php-session-serializer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wikimedia/php-session-serializer

最新稳定版本:v3.0.2

Composer 安装命令:

composer require wikimedia/php-session-serializer

包简介

Provides methods like PHP's session_encode and session_decode that don't mess with $_SESSION

README 文档

README

Latest Stable Version License

php-session-serializer

php-session-serializer is a PHP library that provides methods that work like PHP's session_encode and session_decode functions, but don't mess with the $_SESSION superglobal.

It supports the php, php_binary, and php_serialize serialize handlers. wddx is not supported, since it is inferior to php and php_binary.

Usage

use Wikimedia\PhpSessionSerializer;

// (optional) Send logs to a PSR-3 logger
PhpSessionSerializer::setLogger( $logger )

// (optional) Ensure that session.serialize_handler is set to a usable value
PhpSessionSerializer::setSerializeHandler();

// Encode session data
$string = PhpSessionSerializer::encode( $array );

// Decode session data
$array = PhpSessionSerializer::decode( $string );

Running tests

composer install --prefer-dist
composer test

History

This library was created to support custom session handler read and write methods that are more useful than blindly storing the serialized data that PHP gives to custom handlers.

统计信息

  • 总下载量: 1.19M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 21
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 1

GitHub 信息

  • Stars: 20
  • Watchers: 13
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2015-10-14