goldfinch/harvest
Composer 安装命令:
composer require goldfinch/harvest
包简介
Harvest is a seeder component that helps you to bundle automation run by Taz
README 文档
README
Harvest is a seeder component 🚟 that helps you to bundle automation run by Taz🌪️.
Install
composer require goldfinch/harvest
Available Taz commands
If you haven't used Taz🌪️ before, taz file must be presented in your root project folder cp vendor/goldfinch/taz/taz taz
Create new harvest
php taz make:harvest
List all available harvesters
php taz harvest
Run specific harvest
php taz harvest myharvest
Run all available harvesters
php taz harvest:all
Use Case example
Let's create a new harvest calling Pages that will handle Page Mill which will generate fake records for us by firing a single command.
1. Create new harvest
php taz make:harvest Pages
# What [short name] does this harvest need to be called by? : pages
After creating new harvest, we need to run dev/build to update harvest list
php taz dev/build
Now our harvest pages should be available in the harvest list, let's check that:
php taz harvest
2. Create new mill
As we decide that our harvest will manage mill factory, we need to create one. For more info about mills please refer to goldfinch/mill
php taz make:mill Page
# What [class name] does this mill is going to work with? : Page
Let's modify our Mill by adding some placeholder data:
namespace App\Mills; use Goldfinch\Mill\Mill; class PageMill extends Mill { public function factory(): array { return [ 'Title' => $this->faker->catchPhrase(), 'Content' => $this->faker->paragraph(20), ]; } }
We also need to make sure that Millable trait is added to Page class as it states in goldfinch/mill.
namespace { use Goldfinch\Mill\Traits\Millable; use SilverStripe\CMS\Model\SiteTree; class Page extends SiteTree { use Millable; private static $db = []; } }
3. Prepare your harvest
Now we can go back to our PageHarvest that was created by Taz in the first step and add our mill to it.
namespace App\Harvest; use Goldfinch\Harvest\Harvest; class PagesHarvest extends Harvest { public static function run(): void { \Page::mill(10)->make(); } }
4. Use harvest
Now our harvest is ready to rock along with Taz. By firing our harvest, we should get 10 newly generated pages in admin site tree.
php taz harvest pages
Recommendation
This module plays nicely with mill factory goldfinch/mill
License
The MIT License (MIT)
goldfinch/harvest 适用场景与选型建议
goldfinch/harvest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 495 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silverstripe」 「Harvest」 「seeder」 「harvest-silverstripe」 「harvest-manager」 「seeder-silverstripe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 goldfinch/harvest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 goldfinch/harvest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 goldfinch/harvest 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Philippines region, province, cities/municipalities and barangays Laravel migration and table seeder.
Versioned, environment-based Seeders in Laravel. Used while original does not update to Laravel 5.7
Analytics chooser extensions for site settings.
CitaNZ's SilverStripe picture object and field for SilverStripe 4
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
统计信息
- 总下载量: 495
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 11
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-24