adbros/worker

用于执行繁重任务的简单交互式工作员。

v0.4.2 2024-05-06 12:52 UTC

README

用于执行繁重任务的简单交互式工作员。灵感来自symfony/maker-bundle

Build Status Code coverage Licence Downloads this Month Downloads total Latest stable

安装

composer require adbros/worker --dev

配置

您可以在根目录中创建worker.php、worker.json或worker.neon来设置默认工作员选项。

默认worker.neon示例

rootDirectory: app
rootNamespace: App

command:
    namespace: App\Commands
    parent: Symfony\Component\Console\Command\Command

control:
    namespace: App\Controls
    controlParent: Nette\Application\UI\Control
    factoryParent:

orm:
    namespace: App\Model\Orm
    entityParent: Nextras\Orm\Entity\Entity
    repositoryParent: Nextras\Orm\Repository\Repository
    mapperParent: Nextras\Orm\Mapper\Mapper

presenter:
    namespace: App\Presenters
    parent: Nette\Application\UI\Presenter

用法

# Generate command for symfony/console package
vendor/bin/worker command [options] [--] [<name>]

# Generate control with factory and template
vendor/bin/worker control [options] [--] [<name>]

# Generate model for nextras/orm package
vendor/bin/worker orm [options] [--] [<entity> [<repository>]]

# Generate presenter and default template
vendor/bin/worker presenter [options] [--] [<name>]

示例

ormJob

ormJob

presenterJob

presenterJob