a7/seeder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

a7/seeder

最新稳定版本:2.3

Composer 安装命令:

composer require a7/seeder

包简介

Perform heavy and/or infrequent actions in a controlled manner

README 文档

README

Purpose

Perform heavy / infrequent actions in a controlled manner.

Usage

Use the A7\Seeder\add_seed function to register the seed.

\A7\Seeder\add_seed( [
	'name'        => 'User Roles',
	'description' => 'Build user roles',
	'callback'    => 'Dev\user_roles',
] );

This registers the seed with the callback of Dev\user_roles. Create a function with that name (in the appropriate namespace) and this will be the function that runs when you initiate the seed.

You can also just create a closure right there:

\A7\Seeder\add_seed( [
	'name'        => 'User Roles',
	'description' => 'Build user roles',
	'callback'    => function() {
		// .. do some logic ..
		
		echo 'Status of logic';
	},
] );
namespace Dev;

function user_roles() {
    // .. do some logic ..
    
    echo 'Status of the logic...';
}

Go to Tools -> Seeder and click the corresponding seed button to initialize the callback that you registered.

This could be anything such as pre-filling content, auto-creating terms, updating the database in a certain manner, talking to or updating an API, etc.

Anything output during the seed callback will get output in an admin notice.

统计信息

  • 总下载量: 9.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-11-22