sebastian/exporter
Composer 安装命令:
composer require sebastian/exporter
包简介
Provides the functionality to export PHP variables for visualization
README 文档
README
sebastian/exporter
This component provides the functionality to export PHP variables for visualization.
Installation
You can add this library as a local, per-project dependency to your project using Composer:
composer require sebastian/exporter
If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:
composer require --dev sebastian/exporter
Usage
Exporting:
<?php use SebastianBergmann\Exporter\Exporter; $exporter = new Exporter; /* Exception Object &0000000078de0f0d000000002003a261 ( 'message' => '' 'string' => '' 'code' => 0 'file' => '/home/sebastianbergmann/test.php' 'line' => 34 'previous' => null ) */ print $exporter->export(new Exception);
Data Types
Exporting simple types:
<?php use SebastianBergmann\Exporter\Exporter; $exporter = new Exporter; // 46 print $exporter->export(46); // 4.0 print $exporter->export(4.0); // 'hello, world!' print $exporter->export('hello, world!'); // false print $exporter->export(false); // NAN print $exporter->export(acos(8)); // -INF print $exporter->export(log(0)); // null print $exporter->export(null); // resource(13) of type (stream) print $exporter->export(fopen('php://stderr', 'w')); // Binary String: 0x000102030405 print $exporter->export(chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5));
Exporting complex types:
<?php use SebastianBergmann\Exporter\Exporter; $exporter = new Exporter; /* Array &0 ( 0 => Array &1 ( 0 => 1 1 => 2 2 => 3 ) 1 => Array &2 ( 0 => '' 1 => 0 2 => false ) ) */ print $exporter->export(array(array(1,2,3), array("",0,FALSE))); /* Array &0 ( 'self' => Array &1 ( 'self' => Array &1 ) ) */ $array = array(); $array['self'] = &$array; print $exporter->export($array); /* stdClass Object &0000000003a66dcc0000000025e723e2 ( 'self' => stdClass Object &0000000003a66dcc0000000025e723e2 ) */ $obj = new stdClass(); $obj->self = $obj; print $exporter->export($obj);
Compact exports:
<?php use SebastianBergmann\Exporter\Exporter; $exporter = new Exporter; // Array () print $exporter->shortenedExport(array()); // Array (...) print $exporter->shortenedExport(array(1,2,3,4,5)); // stdClass Object () print $exporter->shortenedExport(new stdClass); // Exception Object (...) print $exporter->shortenedExport(new Exception); // this\nis\na\nsuper\nlong\nstring\nt...\nspace print $exporter->shortenedExport( <<<LONG_STRING this is a super long string that wraps a lot and eats up a lot of space LONG_STRING );
sebastian/exporter 适用场景与选型建议
sebastian/exporter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 931.7M 次下载、GitHub Stars 达 6.82k, 最近一次更新时间为 2013 年 02 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「export」 「exporter」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sebastian/exporter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sebastian/exporter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sebastian/exporter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Base contracts implementation for Prometheus exports in Laravel.
Bulk export of sylius resources
Yii2 export extension
A simple API extension for SplFileObject
统计信息
- 总下载量: 931.7M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6831
- 点击次数: 22
- 依赖项目数: 72
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2013-02-16