daanbiesterbos/command-extra-bundle

Minimal symfony bundle that adds functionality to alias symfony commands.

v1.0.1 2021-04-16 18:04 UTC

This package is auto-updated.

Last update: 2024-04-19 22:49:58 UTC


README

Build CommandExtraBundle Latest Stable Version Total Downloads

Installation

This bundle is available on Packagist. You can install it using Composer.

composer require daanbiesterbos/command-extra-bundle

Step 2: Enable the bundle

Add the bundle to config/bundles.php

return [
    DaanBiesterbos\CommandExtraBundle\CommandExtraBundle::class => ['all' => true],
];

Step 3: Configure the bundle

Finally, configure the bundle:

# config/packages/command_extra.yaml
command_extra:
  aliases:
    # Example 1:
    # Register alias to run a non symfony command.
    ps:
      name: 'ps'
      description: 'Shorthand example of a non symfony command.'
      execute: 'ps -aux'  # This shorthand is for non-symfony commands only.
    # Example 2
    # Register alias that runs two symfony commands when invoked.
    cache_purge:
      name: 'cache:purge'
      description: 'Prune cache pools and application cache.'
      execute:
        # Run multiple commands 
        cache_pool:
          command: 'cache:pool:prune'
          symfony: true
        app_cache:
          command: 'cache:clear'
          symfony: true