承接 goldfinch/harvest 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

goldfinch/harvest

Composer 安装命令:

composer require goldfinch/harvest

包简介

Harvest is a seeder component that helps you to bundle automation run by Taz

README 文档

README

Silverstripe Version Package Version Total Downloads License

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 goldfinch/harvest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 495
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 26
  • 依赖项目数: 11
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-24