pk/command-extra-bundle
Adds a set of extra console commands to Laravel/PHP applications, extending Artisan with handy utilities for common development and maintenance tasks. Drop-in service provider registration keeps setup minimal, with commands designed to be simple to configure and extend for your own workflow.
This bundle targets Symfony 2.x and has been archived since early 2016, so treat the first hour as reconnaissance rather than a normal install.
composer.json will constrain symfony/symfony (or the symfony/console / symfony/framework-bundle components) to a 2.x range. Run composer show pk/command-extra-bundle --all in a scratch project to see the constraint before you try to require it into a Symfony 3/4/5 app — Composer will refuse, and forcing it with --ignore-platform-reqs rarely helps because the Symfony Console API changed.composer require pk/command-extra-bundle
If that fails, pin the last release tag that matches your Symfony minor version.app/AppKernel.php:
$bundles = array(
// ...
new PK\CommandExtraBundle\PKCommandExtraBundle(),
);
Check the class name against vendor/pkruithof/command-extra-bundle/ — the namespace is the first thing to verify, since the repo description ("adds some flavor") tells you almost nothing about the API surface.src/ and any Resources/config/services.xml are more reliable than docs. Look for: a base Command class to extend, output/style helper methods, and any service tags that auto-register commands.Because the bundle is small and frozen, the useful patterns are the ones that work around an unmaintained dependency, not deep integration.
ContainerAwareCommand, then override configure()/execute() as usual. Keep the base class behind a thin abstraction of your own so you can swap it later.$output->writeln() directly. This is the seam to replace when you migrate.CommandStylerInterface (or similar) and let the bundle's helper be one implementation. That way a later move to Symfony's SymfonyStyle is a one-file change.kernel.command tag convention, mirror it deliberately; don't rely on directory-scanning assumptions you haven't verified in services.xml.SymfonyStyle (2.7+), and reserve the bundle only for legacy commands that already depend on it. This limits blast radius.CommandTester and assert on getDisplay(). This is bundle-agnostic and lets you verify the bundle's output helpers actually behave as expected before you rely on them.interact()/run() signatures between 2.x and 3.x. A composer constraint written for 2.x will block Symfony 3+; check whether the bundle pins a component or the whole framework.composer install on PHP 8 will surface deprecations (dynamic properties, each(), etc.) in the bundle itself.class .*Command, setName, and any TaggedService/compiler-pass code to map the real API in five minutes.DependencyInjection/ for an extension that reads the pk_command_extra config key. If a config node exists but fails silently when missing, add it explicitly to config.yml rather than relying on defaults.SymfonyStyle, OutputFormatter, and standard Command subclasses on the next Symfony upgrade.composer.json notes/README as legacy, and add a test command that exercises it so an upgrade failure surfaces immediately rather than at runtime.How can I help you explore Laravel packages today?