mihai-stancu/serializer
Composer 安装命令:
composer require mihai-stancu/serializer
包简介
Customized normalizers and a collection of encoders.
README 文档
README
Contents
A recursive normalizer that uses symfony/property-info to deduce data types of elements in an object graph.
A type hinted normalizer that retains type information about the object graph being normalized.
A collection of (symfony compliant) encoders for the following formats:
- Bencode as a pure PHP implementation provided by rych/bencode.
- BSON as a PHP extension provided by the
mongoextension. - CBOR as a pure PHP implementation provided by 2tvenom/cborencode.
- Export as a PHP core functionality.
- Form as a PHP core functionality.
- IGBinary as a PHP extension provided by the
igbinaryextension -- as a drop-in replacement forPHP Serialize. - Ini PHP implementation provided by zendframework/zend-config.
- MsgPack as a PHP extension provided by the
msgpackextension. - Rison as a pure PHP implementation provided by deceze/Kunststube-Rison.
//Serealas a pure PHP implementation provided by tobyink/sereal.- Serialize as a PHP core functionality.
//Smileas a PHP extension provided by thelibsmileextension.- Tnetstring as a pure PHP implementation provided by phuedx/tnetstring.
- UBJSON as a pure PHP implementation provided by dizews/php-ubjson.
- YAML as a PHP extension provided by the
yamlextension or a pure PHP implementation provided by symfony/yaml.
Installation
Choose one ore more encoding formats from the suggestions in composer.json. If
the chosen format is described below as PHP extension you will have to install
said extension. If it is a pure PHP implementation you will be able to require
it via composer.
composer require mihai-stancu/serializer composer require your-chosen/encoder-package
// in AppKernel::registerBundles() $bundles = array( // ... new MS\SerializerBundle\MSSerializerBundle(), // ... );
Usage
After having installed the bundle and at least one of the suggested encoding formats, that encoding format will be registered as a serialization format for the symfony/serializer.
$encoderName = array_rand( array( 'bencode', 'bson', 'cbor', 'export', 'form', 'igbinary', 'ini', 'msgpack', 'rison', //'sereal', 'serial', //'smile', 'tnetstring', 'ubjson', 'yaml', ) ); $serializer = $container->get('serializer'); $string = $serializer->serialize($data, $encoderName); $data = $serializer->unserialize($data, $class, $encoderName);
mihai-stancu/serializer 适用场景与选型建议
mihai-stancu/serializer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 50.42k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 09 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「serialize」 「encode」 「Marshal」 「normalize」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mihai-stancu/serializer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mihai-stancu/serializer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mihai-stancu/serializer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The Aura Marshal package is a data-object marshalling tool; it takes results from data sources and marshals those result sets into domain model objects of your own design, preserving data relationships along the way.
LazyPDO is a set of wrappers over PHP's standard PDO and PDOStatement classes. It enables lazy loading, serialization and decoration.
Transform data structures
Lightweight PHP library that allows exchanging binary data with Qt programs (QDataStream)
Encode integer IDs using a preset or customized symbol set
Library for mapping variable types to other types
统计信息
- 总下载量: 50.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 17
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-22