Skip to content

Commit

Permalink
[console] Add DrupalFinder as constructor argument. (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Jan 30, 2018
1 parent b018bdf commit d7bd067
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/Bootstrap/DrupalConsoleCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Drupal\Console\Core\Bootstrap;

use Drupal\Console\Core\Utils\DrupalFinder;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
Expand All @@ -28,16 +29,26 @@ class DrupalConsoleCore
*/
protected $appRoot;

/**
* @var DrupalFinder
*/
protected $drupalFinder;

/**
* DrupalConsole constructor.
*
* @param $root
* @param $appRoot
* @param string $root
* @param string $appRoot
* @param DrupalFinder $drupalFinder
*/
public function __construct($root, $appRoot = null)
{
public function __construct(
$root,
$appRoot = null,
DrupalFinder $drupalFinder
) {
$this->root = $root;
$this->appRoot = $appRoot;
$this->drupalFinder = $drupalFinder;
}

/**
Expand Down Expand Up @@ -82,6 +93,11 @@ public function boot()
$consoleRoot
);

$container->set(
'console.drupal_finder',
$this->drupalFinder
);

$configurationManager = $container->get('console.configuration_manager');
$directory = $configurationManager->getConsoleDirectory() . 'extend/';
$autoloadFile = $directory . 'vendor/autoload.php';
Expand Down

0 comments on commit d7bd067

Please sign in to comment.