Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / bin / drupal.php
index 35c172344b0a0e734305fb650ec03b85df3a18ea..6c5b26be9bdf9653a1a67d0c64675abc6cb9786f 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 
-use Symfony\Component\Console\Input\ArgvInput;
-use DrupalFinder\DrupalFinder;
+use Drupal\Console\Core\Utils\DrupalFinder;
 use Drupal\Console\Core\Utils\ArgvInputReader;
 use Drupal\Console\Bootstrap\Drupal;
 use Drupal\Console\Application;
+use Drupal\Console\Core\Utils\ConfigurationManager;
 
 set_time_limit(0);
 
@@ -33,9 +33,6 @@ if (isset($autoloader)) {
     exit(1);
 }
 
-$argvInput = new ArgvInput();
-$debug = $argvInput->hasParameterOption(['--debug']);
-
 $drupalFinder = new DrupalFinder();
 if (!$drupalFinder->locateRoot(getcwd())) {
     echo ' DrupalConsole must be executed within a Drupal Site.'.PHP_EOL;
@@ -43,12 +40,20 @@ if (!$drupalFinder->locateRoot(getcwd())) {
     exit(1);
 }
 
-$composerRoot = $drupalFinder->getComposerRoot();
-$drupalRoot = $drupalFinder->getDrupalRoot();
-chdir($drupalRoot);
+chdir($drupalFinder->getDrupalRoot());
+
+$configurationManager = new ConfigurationManager();
+$configuration = $configurationManager
+    ->loadConfigurationFromDirectory($drupalFinder->getComposerRoot());
+
+$argvInputReader = new ArgvInputReader();
+if ($configuration && $options = $configuration->get('application.options') ?: []) {
+    $argvInputReader->setOptionsFromConfiguration($options);
+}
+$argvInputReader->setOptionsAsArgv();
 
-$drupal = new Drupal($autoload, $composerRoot, $drupalRoot);
-$container = $drupal->boot($debug);
+$drupal = new Drupal($autoload, $drupalFinder);
+$container = $drupal->boot();
 
 if (!$container) {
     echo ' Something was wrong. Drupal can not be bootstrap.';
@@ -56,14 +61,6 @@ if (!$container) {
     exit(1);
 }
 
-$configuration = $container->get('console.configuration_manager')
-    ->getConfiguration();
-
-$argvInputReader = new ArgvInputReader();
-if ($options = $configuration->get('application.options') ?: []) {
-    $argvInputReader->setOptionsFromConfiguration($options);
-}
-$argvInputReader->setOptionsAsArgv();
 $application = new Application($container);
 $application->setDefaultCommand('about');
 $application->run();