trendyminds/craft-reporter
Composer 安装命令:
composer require trendyminds/craft-reporter
包简介
Export Craft data as CSVs in a snap
关键字:
README 文档
README
📊 Export Craft data as CSVs in a snap!
⚡️ Features
- 🏎 Reports are processed with Query Batching, making exports run quickly and without exhausting your memory limit
- 🧘 Inspired by Element API, create reports with a simple and familiar structure
- 📦 Reports stored using Asset volumes so you can host reports locally or on a cloud-based service like Amazon S3
- 🖥 Process reports via the CLI using
php craft reporter/report --handle=myReportwheremyReportis the key of a specific report in thereportsarray found inconfig/reporter.php.
📦 Installing
Install Reporter one of two ways:
- Install via Craft's Plugin Store
- Run
composer require trendyminds/craft-reporterand enable the plugin from "Settings > Plugins"
🔌 Setup
To setup reports, create a reporter.php file in config/. Below is an example config file.
Example Config
<?php use craft\elements\Entry; use craft\elements\Asset; return [ // The name to use throughout the control panel (defaults to "Reporter") 'displayName' => 'Reports', // The asset volume handle where your reports should be saved // NOTE: Your reports are publicly accessible if your volume has "Assets in this volume have public URLs" enabled 'volume' => 'uploads', // An optional folder path if you would like to nest the reports in a specific directory 'folder' => 'resources/reports', // An optional batch size to use when processing reports (defaults to 100) 'batchSize' => 100, // An array of reports to produce 'reports' => [ 'pages' => function () { return [ 'name' => 'All Pages', 'description' => 'A simple export of all the pages on the site.', 'elementType' => Entry::class, 'criteria' => [ 'section' => 'pages' ], 'transformer' => function (Entry $entry) { return [ "id" => $entry->id, "title" => $entry->title, "url" => $entry->url, ]; } ]; }, 'allImages' => function () { return [ 'name' => 'Uploaded Images', 'description' => 'A list of all images uploaded into Craft', 'elementType' => Asset::class, 'criteria' => [ 'kind' => 'image' ], 'transformer' => function (Asset $asset) { // Skip example // Ignore assets that have an even number for an ID if ($asset->id % 2 === 0) { return []; } return [ "id" => $asset->id, "title" => $asset->title, "filename" => $asset->filename, ]; } ]; }, ] ];
🤝 Contributing
If you would like to contribute to Reporter we tried to make it as easy as possible:
- Clone the repo
- Run
npm ito install the Node dependencies - Run
npm startto begin the watch task - Make your changes
- Run
npm run buildto compile and minify the CSS and JS - Submit a PR!
trendyminds/craft-reporter 适用场景与选型建议
trendyminds/craft-reporter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.94k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2022 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「reports」 「Craft」 「craft cms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 trendyminds/craft-reporter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 trendyminds/craft-reporter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 trendyminds/craft-reporter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Expand, collapse, change the status of, or delete multiple blocks in a Matrix field simultaneously.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Integrate with Snipcart.
Library for easily converting reports into various HTTP responses
统计信息
- 总下载量: 2.94k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-17

