Skip to content
Snippets Groups Projects

Refactor "dex" front controller into existing "drupal" front controller, combining management of both bootstrapping and non-bootstrapping commands.

4 unresolved threads

The changes here could be merged into !8344 (diffs)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
114 115 "includes/bootstrap.inc"
115 116 ]
116 117 },
118 "bin": [
119 "bin/dex",
120 "scripts/drupal"
  • Something I forgot earlier; core/scripts/drupal is not currently placed in vendor/bin because Drupal Console places its drupal script in vendor/bin. I am uncertain whether Drupal Console will support Drupal 11; they do currently have Drupal 10 support, but only in a development version. This might be an opportunity to convert the core commands to use #AsCommand, and unify the front controller to use the one provided by Core. It would probably be best for now to not put core's drupal in vendor/bin.

    Was namespace collision issues with Drupal Console an additional unspoken reason for proposing dex over the extension of the existing drupal script? There are definitely some remaining complexities here.

  • Please register or sign in to reply
  • core/scripts/drupal 100644 → 100755
    9 use Drupal\Core\Command\GenerateTheme;
    10 use Drupal\Core\Command\QuickStartCommand;
    11 use Drupal\Core\Command\InstallCommand;
    12 use Drupal\Core\Command\ServerCommand;
    13 use Drupal\Core\Recipe\RecipeCommand;
    14 use Symfony\Component\Console\Application;
    15
    16 if (PHP_SAPI !== 'cli') {
    17 return;
    18 }
    9 declare(strict_types = 1);
    19 10
    20 $classloader = require_once __DIR__ . '/../../autoload.php';
    11 use Composer\Autoload\ClassLoader;
    12 use Drupal\Core\Command\DrupalApplication;
    13 use Drupal\Core\DrupalKernel;
  • 9 use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
    10 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
    11 use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
    12 use Symfony\Component\DependencyInjection\ContainerBuilder;
    13 use Symfony\Component\DependencyInjection\Definition;
    14 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
    15 use Symfony\Component\DependencyInjection\Reference;
    16
    17 /**
    18 * System compiler pass.
    19 *
    20 * Inspired by:
    21 * - \Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass()
    22 * - \Symfony\Bundle\FrameworkBundle\Console\Application::registerCommands()
    23 */
    24 final class DexCompilerPass implements CompilerPassInterface {
  • 2
    3 declare(strict_types=1);
    4
    5 namespace Drupal\system\Command;
    6
    7 use Drupal\Component\Datetime\TimeInterface;
    8 use Symfony\Component\Console\Attribute\AsCommand;
    9 use Symfony\Component\Console\Command\Command;
    10 use Symfony\Component\Console\Input\InputInterface;
    11 use Symfony\Component\Console\Output\OutputInterface;
    12 use Symfony\Component\Console\Style\SymfonyStyle;
    13
    14 /**
    15 * Example module command.
    16 *
    17 * Ultimately, I think we should remove this from the MR, but it is
    • We could/should move some of this into system.api.php as a topic (defgroup). That may also help explain some of the current DexExample commands how to autowire services into the command for core contributors to follow-up on this.

    • Please register or sign in to reply
  • Bhanu D added 1 commit

    added 1 commit

    • 69367cab - Update DrupalApplication.php

    Compare with previous version

  • Bhanu D added 1 commit

    added 1 commit

    • b5fde5ab - Update DrupalModuleCommandDiscovery.php

    Compare with previous version

  • Please register or sign in to reply
    Loading