nokimaro / draperstudio-payload

多种数据类型的序列化/反序列化工具

dev-master / 1.0.x-dev 2016-10-18 11:00 UTC

This package is not auto-updated.

Last update: 2024-09-18 20:04:32 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

安装

通过 Composer 安装

$ composer require draperstudio/payload

用法

序列化输入
(new Arr())->serialise($input);
(new Csv())->serialise($input);
(new Ini())->serialise($input);
(new Json())->serialise($input);
(new Value())->serialise($input);
(new Xml())->serialise($input);
(new Yaml())->serialise($input);
(new YamlInline())->serialise($input);
反序列化输入
(new Arr())->unserialise($contents, $class);
(new Csv())->unserialise($contents, $class);
(new Ini())->unserialise($contents, $class);
(new Json())->unserialise($contents, $class);
(new Value())->unserialise($contents, $class);
(new Xml())->unserialise($contents, $class);
(new Yaml())->unserialise($contents, $class);
读取文件并反序列化其内容
(new Arr())->read($path, $class);
(new Csv())->read($path, $class);
(new Ini())->read($path, $class);
(new Json())->read($path, $class);
(new Value())->read($path, $class);
(new Xml())->read($path, $class);
(new Yaml())->read($path, $class);
序列化输入并将其写入文件
(new Arr())->write($path, $input);
(new Csv())->write($path, $input);
(new Ini())->write($path, $input);
(new Json())->write($path, $input);
(new Value())->write($path, $input);
(new Xml())->write($path, $input);
(new Yaml())->write($path, $input);
(new YamlInline())->write($path, $input);

变更日志

请参阅 CHANGELOG 以获取最近变更的详细信息。

测试

$ composer test

贡献

请参阅 CONTRIBUTINGCONDUCT 以获取详细信息。

安全

如果您发现任何与安全相关的问题,请通过电子邮件 hello@draperstudio.tech 联系我们,而不是使用问题跟踪器。

鸣谢

许可

MIT 许可证 (MIT)。请参阅 许可文件 以获取更多信息。