qafoo/ser-pretty 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

qafoo/ser-pretty

Composer 安装命令:

composer require qafoo/ser-pretty

包简介

Pretty print serialized PHP data

README 文档

README

Build Status

ser-pretty prints serialized PHP in the style of var_dump() without sourcing the required classes.

$ src/bin/ser-pretty test.txt 
  class stdClass (1) {
    private $bar =>
    int(223)
  }

Download ser-pretty as a PHAR or require qafoo/ser-pretty via composer.

But, why?

It happens often that you have serialized PHP data lying around, e.g. from caching, session data or transmitting it through a queue. If you want to inspect this data for debugging purposes you typically write a tiny script that loads your classes (which are needed for de-serialization), get the data and display a var dump.

ser-pretty deprecates the script-step by simply rendering a var_dump() outut from serialized data, without needing to source the class source.

The CLI

ser-pretty comes with a very simple PHP CLI script, that reads serialized data from STDIN or a given file and prints the formatted output to STDOUT. Just call:

$ ser-pretty.phar dumped_data.txt

This even works for Doctrine annotation cache files since ser-pretty 0.2.0.

You can also pipe serialized data from another script to it:

$ some_script.php | ser-pretty.phar

The Lib

You can also use ser-pretty as a library to integrate pretty printing of serialized PHP data into your debugging/monitoring/… tools. Just look into the CLI script to see what it does.

  • The Parser parses serialized into a very simple AST
  • A Writer turns an AST into a string representation

ser-pretty ships with a var_dump() style writer, the SimpleTextWriter which you can use out of the box. You can implement your own writer by deriving the Writer class.

Installation

Just include ser-pretty in your project via composer using or download the latest PHAR.

qafoo/ser-pretty 适用场景与选型建议

qafoo/ser-pretty 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 159k 次下载、GitHub Stars 达 40, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 qafoo/ser-pretty 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 qafoo/ser-pretty 我们能提供哪些服务?
定制开发 / 二次开发

基于 qafoo/ser-pretty 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 159k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 40
  • 点击次数: 19
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 40
  • Watchers: 6
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知