Skip to content

Commit

Permalink
Register extend commmands. (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Feb 5, 2017
1 parent 3b82904 commit 395bb4c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
$this->commandName = $commandName;
}
$this->registerEvents();
$this->registerExtendCommands();
$this->registerCommandsFromAutoWireConfiguration();
$this->registerChainCommands();

Expand Down Expand Up @@ -274,6 +275,15 @@ private function addOptions()
);
}

/**
* registerExtendCommands
*/
private function registerExtendCommands()
{
$this->container->get('console.configuration_manager')
->loadExtendConfiguration();
}

/**
* registerCommandsFromAutoWireConfiguration
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Bootstrap/DrupalConsoleCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ public function boot()
$consoleRoot
);

$configurationManager = $container->get('console.configuration_manager');
$directory = $configurationManager->getConsoleDirectory() . 'extend/';
$autoloadFile = $directory . 'vendor/autoload.php';
if (is_file($autoloadFile)) {
include_once $autoloadFile;
$extendServicesFile = $directory . 'extend.console.services.yml';
if (is_file($extendServicesFile)) {
$loader->load($extendServicesFile);
}
}

$container->get('console.renderer')
->setSkeletonDirs(
[
Expand Down

0 comments on commit 395bb4c

Please sign in to comment.