adbros/worker

Simple interactive worker for doing hard jobs.

v0.3.2 2020-05-17 13:24 UTC

README

Simple interactive worker for doing hard jobs. Inspired by symfony/maker-bundle.

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

Installation

composer require adbros/worker --dev

Configuration

You can create worker.php, worker.json or worker.neon in your root directory to setup default Worker options.

default worker.neon example

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

Usage

# 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>]

Examples

ormJob

ormJob

presenterJob

presenterJob