Skip to content
Add lazily loaded symfony/console commands by default name.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.php_cs.dist
README.md
composer.json
phpunit.xml.dist

README.md

Add lazily loaded symfony/console commands by default name.

use App\Command\HeavyCommand;
use App\Command\AnotherCommand;
use Brucep\CommandLoader\DefaultNameCommandLoader;
use Symfony\Component\Console\Application;

// Classes must define their $defaultName static property
$commandLoader = new DefaultNameCommandLoader([
    HeavyCommand::class,
    AnotherCommand::class,
]);

$application = new Application();
$application->setCommandLoader($commandLoader);
$application->run();

See also: How to Make Commands Lazily Loaded

You can’t perform that action at this time.