简体   繁体   English

如何解析Java中的PHP序列化数据结构?

[英]How do I parse a PHP serialized datastructure in Java?

I have a system that combines the best and worst of Java and PHP. 我的系统结合了Java和PHP的优点和缺点。 I am trying to migrate a component that was once written in PHP into a Java One. 我正在尝试将曾经用PHP编写的组件迁移到Java One中。

Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? 有人对我如何解析Java中的PHP序列化数据结构有一些提示吗? By serialized I mean output from php's serialize function. 序列化是指php的序列化功能的输出。

I had the same issue and found this library: http://code.google.com/p/serialized-php-parser/ 我遇到了同样的问题,并找到了这个库: http : //code.google.com/p/serialized-php-parser/

It does exactly what you need 完全满足您的需求

PHP serializes to a simple text-based format. PHP序列化为基于文本的简单格式。 PHPSerialize looks like a parser written in Java. PHPSerialize看起来像用Java编写的解析器。 You can also port the Python implementation to Java -- I doubt it's very complex. 您还可以将Python实现移植到Java -我怀疑它是否非常复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM