configure example

/** * Command that will validate your template syntax and output encountered errors. * * @author Marc Weistroff <marc.weistroff@sensiolabs.com> * @author Jérôme Tamarelle <jerome@tamarelle.net> */
#[AsCommand(name: 'lint:twig', description: 'Lint a Twig template and outputs encountered errors')] final class LintCommand extends BaseLintCommand
{
    protected function configure(): void
    {
        parent::configure();

        $this
            ->setHelp(
                $this->getHelp().<<<'EOF' Or all template files in a bundle: <info>php %command.full_name% @AcmeDemoBundle</info> EOF
            )
        ;
return $this->queryPluginNames($context->getCurrentWord());
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('sw:plugin:reinstall')
            ->setDescription('Reinstalls the provided plugin')
            ->addArgument(
                'plugin',
                InputArgument::REQUIRED,
                'Name of the plugin to be installed.'
            )
            ->addOption(
                'removedata',
                
->setDescription('Installs a Drupal site and runs a web server. This is not meant for production and might be too simple for custom development. It is a quick and easy way to get Drupal running.')
      ->addArgument('install-profile', InputArgument::OPTIONAL, 'Install profile to install the site in.')
      ->addOption('langcode', NULL, InputOption::VALUE_OPTIONAL, 'The language to install the site in. Defaults to en.', 'en')
      ->addOption('site-name', NULL, InputOption::VALUE_OPTIONAL, 'Set the site name. Defaults to Drupal.', 'Drupal')
      ->addOption('host', NULL, InputOption::VALUE_OPTIONAL, 'Provide a host for the server to run on. Defaults to 127.0.0.1.', '127.0.0.1')
      ->addOption('port', NULL, InputOption::VALUE_OPTIONAL, 'Provide a port for the server to run on. Will be determined automatically if none supplied.')
      ->addOption('suppress-login', 's', InputOption::VALUE_NONE, 'Disable opening a login URL in a browser.')
      ->addUsage('demo_umami --langcode fr')
      ->addUsage('standard --site-name QuickInstall --host localhost --port 8080')
      ->addUsage('minimal --host my-site.com --port 80');

    parent::configure();
  }

  /** * {@inheritdoc} */
  protected function execute(InputInterface $input, OutputInterface $output): int {
    $command = $this->getApplication()->find('install');

    $arguments = [
      'command' => 'install',
      'install-profile' => $input->getArgument('install-profile'),
      

  protected function configure() {
    $this->setName('install')
      ->setDescription('Installs a Drupal demo site. This is not meant for production and might be too simple for custom development. It is a quick and easy way to get Drupal running.')
      ->addArgument('install-profile', InputArgument::OPTIONAL, 'Install profile to install the site in.')
      ->addOption('langcode', NULL, InputOption::VALUE_OPTIONAL, 'The language to install the site in.', 'en')
      ->addOption('site-name', NULL, InputOption::VALUE_OPTIONAL, 'Set the site name.', 'Drupal')
      ->addUsage('demo_umami --langcode fr')
      ->addUsage('standard --site-name QuickInstall');

    parent::configure();
  }

  /** * {@inheritdoc} */
  protected function execute(InputInterface $input, OutputInterface $output): int {
    $io = new SymfonyStyle($input$output);
    if (!extension_loaded('pdo_sqlite')) {
      $io->getErrorStyle()->error('You must have the pdo_sqlite PHP extension installed. See core/INSTALL.sqlite.txt for instructions.');
      return 1;
    }

    
return array_column($result, 'name');
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('sw:plugin:activate')
            ->setDescription('Activates a plugin.')
            ->addArgument(
                'plugin',
                InputArgument::REQUIRED,
                'Name of the plugin to be activated.'
            )
            ->setHelp(
                <<<'EOF'
use Symfony\Component\Console\Input\InputOption;

#[AsCommand(     name: 'database:migrate-destructive',
    description: 'Executes all migrations',
)]
#[Package('core')] class MigrationDestructiveCommand extends MigrationCommand
{
    protected function configure(): void
    {
        parent::configure();

        $this->addOption(
            'version-selection-mode',
            null,
            InputOption::VALUE_REQUIRED,
            'Define upto which version destructive migrations are executed. Possible values: "safe", "blue-green", "all".',
            MigrationCollectionLoader::VERSION_SELECTION_SAFE
        );
    }

    protected function getMigrationGenerator(MigrationCollection $collection, ?int $until, ?int $limit): \Generator
    {
return array_column($result, 'name');
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('sw:plugin:deactivate')
            ->setDescription('Deactivates a plugin.')
            ->addArgument(
                'plugin',
                InputArgument::REQUIRED,
                'Name of the plugin to be deactivated.'
            )
            ->setHelp(
                <<<'EOF'
$this->logger->error('Session: session.auto_start is enabled in php.ini. Aborting.');

            return;
        }

        if (session_status() === PHP_SESSION_ACTIVE) {
            $this->logger->warning('Session: Sessions is enabled, and one exists. Please don\'t $session->start();');

            return;
        }

        $this->configure();
        $this->setSaveHandler();

        // Sanitize the cookie, because apparently PHP doesn't do that for userspace handlers         if (isset($_COOKIE[$this->config->cookieName])
            && (is_string($_COOKIE[$this->config->cookieName]) || ! preg_match('#\A' . $this->sidRegexp . '\z#', $_COOKIE[$this->config->cookieName]))
        ) {
            unset($_COOKIE[$this->config->cookieName]);
        }

        $this->startSession();

        


/** * Concrete command implementation for testing base features. */
class DbCommandBaseTester extends DbCommandBase {

  /** * {@inheritdoc} */
  public function configure() {
    parent::configure();
    $this->setName('test');
  }

  /** * {@inheritdoc} */
  public function getDatabaseConnection(InputInterface $input) {
    return parent::getDatabaseConnection($input);
  }

  /** * {@inheritdoc} */

    public function __construct(
        private readonly DefinitionInstanceRegistry $registry,
        string $rootDir
    ) {
        parent::__construct();
        $this->dir = $rootDir . '/platform/src';
    }

    protected function configure(): void
    {
        parent::configure();
        $this->addArgument('whitelist', InputArgument::IS_ARRAY);
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        if ($this->hasInactiveFeatureFlag()) {
            throw new \RuntimeException('You have to enable all feature flags when running this command. Simply add FEATURE_ALL=major to your .env file');
        }

        $io = new ShopwareStyle($input$output);
        $io->title('DAL generate hydrators');

        

class DbImportCommand extends DbCommandBase {

  /** * {@inheritdoc} */
  protected function configure() {
    parent::configure();
    $this->setName('import')
      ->setDescription('Import database from a generation script.')
      ->addArgument('script', InputOption::VALUE_REQUIRED, 'Import script');
  }

  /** * {@inheritdoc} */
  protected function execute(InputInterface $input, OutputInterface $output): int {
    $script = $input->getArgument('script');
    if (!is_file($script)) {
      
return $this->queryPluginNames($context->getCurrentWord());
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('sw:plugin:update')
            ->setDescription('Updates specified plugins.')
            ->addArgument(
                'plugin',
                InputArgument::IS_ARRAY | InputArgument::OPTIONAL,
                'Space separated list of plugins to be updated. Ignored if --batch option is used'
            )
            ->addOption(
                'batch',
                
return array_column($result, 'name');
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        parent::configure();

        $this
            ->setName('sw:plugin:uninstall')
            ->setDescription('Uninstalls a plugin.')
            ->addArgument(
                'plugin',
                InputArgument::REQUIRED,
                'Name of the plugin to be uninstalled.'
            )
            ->addOption(
                'secure',
                

    public function boot()
    {
        $_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger';

        $handler = ErrorHandler::register(null, false);

        // When upgrading an existing Symfony application from 6.2 to 6.3, and         // the cache is warmed up, the service is not available yet, so we need         // to check if it exists.         if ($this->container->has('debug.error_handler_configurator')) {
            $this->container->get('debug.error_handler_configurator')->configure($handler);
        }

        if ($this->container->getParameter('kernel.http_method_override')) {
            Request::enableHttpMethodParameterOverride();
        }

        if ($this->container->hasParameter('kernel.trust_x_sendfile_type_header') && $this->container->getParameter('kernel.trust_x_sendfile_type_header')) {
            BinaryFileResponse::trustXSendfileTypeHeader();
        }
    }

    
public function __construct(
        private readonly EntityRepository $snippetSetRepository,
        SalesChannelCreator $salesChannelCreator
    ) {
        parent::__construct(
            $salesChannelCreator
        );
    }

    protected function configure(): void
    {
        parent::configure();

        $this
            ->addOption('url', null, InputOption::VALUE_REQUIRED, 'App URL for storefront')
            ->addOption('snippetSetId', null, InputOption::VALUE_REQUIRED, 'Default snippet set')
            ->addOption('isoCode', null, InputOption::VALUE_REQUIRED, 'Snippet set iso code')
        ;
    }

    protected function getTypeId(): string
    {
        return Defaults::SALES_CHANNEL_TYPE_STOREFRONT;
    }
Home | Imprint | This part of the site doesn't use cookies.