drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.33k stars 1.08k forks source link

Cannot use boolean values in config #2956

Open weitzman opened 6 years ago

weitzman commented 6 years ago

For example, the following does have any effect as seen by the command callback not getting right value in $options.

command:
  image-flush:
      options:
        all: true
greg-1-anderson commented 6 years ago

See https://github.com/symfony/symfony/issues/24314

weitzman commented 2 years ago

Now that Symfony pr is merged, what do we need to do to support these options in our config?

greg-1-anderson commented 2 years ago

This feature is only in Symfony 5+ (so Drupal 10+). We need support in consolidation/config; I think it should be easy, but I don't remember the code very well, will need to look at it. I don't think that Drush will need to do anything.

marcinmaruszewski commented 5 months ago

In my opinion, this problem still occurs in the following configuration:

asm89/stack-cors                         v2.2.0   Cross-origin resource sharing library and stack middleware
chi-teck/drupal-code-generator           3.4.0    Drupal code generator
composer/installers                      v2.2.0   A multi-framework Composer library installer
composer/semver                          3.4.0    Semver library that offers utilities, version constraint parsing and validation.
consolidation/annotated-command          4.9.2    Initialize Symfony Console commands from annotated command class methods.
consolidation/config                     2.1.2    Provide configuration services for a commandline tool.
consolidation/filter-via-dot-access-data 2.0.2    This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.
consolidation/log                        3.0.0    Improved Psr-3 / Psr\Log logger based on Symfony Console components.
consolidation/output-formatters          4.3.2    Format text by applying transformations provided by plug-in formatters.
consolidation/robo                       4.0.6    Modern task runner
consolidation/self-update                2.2.0    Provides a self:update command for Symfony Console applications.
consolidation/site-alias                 4.0.1    Manage alias records for local and remote sites.
consolidation/site-process               5.2.0    A thin wrapper around the Symfony Process Component that allows applications to use the Site Alias library to specify the target for a remote call.
dflydev/dot-access-data                  v3.0.2   Given a deep data structure, access data by dot notation.
doctrine/annotations                     1.14.3   Docblock Annotations Parser
doctrine/deprecations                    1.1.3    A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
doctrine/lexer                           2.1.1    PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
drupal/core                              10.2.4   Drupal is an open source content management platform powering millions of websites and applications.
drupal/core-composer-scaffold            10.2.4   A flexible Composer project scaffold builder.
drupal/core-project-message              10.2.4   Adds a message after Composer installation.
drupal/core-recommended                  10.2.4   Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core.
drush/drush                              12.4.4   Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hou...
egulias/email-validator                  4.0.2    A library for validating emails against several RFCs
grasmash/expander                        3.0.0    Expands internal property references in PHP arrays file.
grasmash/yaml-cli                        3.1.0    A command line tool for reading and manipulating yaml files.
guzzlehttp/guzzle                        7.8.1    Guzzle is a PHP HTTP client library
guzzlehttp/promises                      2.0.2    Guzzle promises library
guzzlehttp/psr7                          2.6.2    PSR-7 message implementation that also provides common utility methods
league/container                         4.2.2    A fast and intuitive dependency injection container.
masterminds/html5                        2.8.1    An HTML5 parser and serializer.
mck89/peast                              v1.15.4  Peast is PHP library that generates AST for JavaScript code
nikic/php-parser                         v5.0.2   A PHP parser written in PHP
pear/archive_tar                         1.4.14   Tar file management class with compression support (gzip, bzip2, lzma2)
pear/console_getopt                      v1.4.3   More info available on: http://pear.php.net/package/Console_Getopt
pear/pear-core-minimal                   v1.10.14 Minimal set of PEAR core files to be used as composer dependency
pear/pear_exception                      v1.0.2   The PEAR Exception base class.
phootwork/collection                     v3.2.2   The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.
phootwork/lang                           v3.2.2   Missing PHP language constructs
phpowermove/docblock                     v4.0     PHP Docblock parser and generator. An API to read and write Docblocks.
psr/cache                                3.0.0    Common interface for caching libraries
psr/container                            2.0.2    Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                     1.0.0    Standard interfaces for event handling.
psr/http-client                          1.0.3    Common interface for HTTP clients
psr/http-factory                         1.0.2    Common interfaces for PSR-7 HTTP message factories
psr/http-message                         2.0      Common interface for HTTP messages
psr/log                                  3.0.0    Common interface for logging libraries
psy/psysh                                v0.12.2  An interactive shell for modern PHP.
ralouphie/getallheaders                  3.0.3    A polyfill for getallheaders.
sebastian/diff                           4.0.6    Diff implementation
symfony/console                          v6.4.4   Eases the creation of beautiful and testable command line interfaces
symfony/dependency-injection             v6.4.4   Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts            v3.4.0   A generic function and convention to trigger deprecation notices
symfony/error-handler                    v6.4.4   Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher                 v6.4.3   Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts       v3.4.0   Generic abstractions related to dispatching event
symfony/filesystem                       v6.4.3   Provides basic utilities for the filesystem
symfony/finder                           v6.4.0   Finds files and directories via an intuitive fluent interface
symfony/http-foundation                  v6.4.4   Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                      v6.4.5   Provides a structured process for converting a Request into a Response
symfony/mailer                           v6.4.4   Helps sending emails
symfony/mime                             v6.4.3   Allows manipulating MIME messages
symfony/polyfill-ctype                   v1.28.0  Symfony polyfill for ctype functions
symfony/polyfill-iconv                   v1.28.0  Symfony polyfill for the Iconv extension
symfony/polyfill-intl-grapheme           v1.28.0  Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-idn                v1.28.0  Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer         v1.28.0  Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring                v1.28.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php72                   v1.29.0  Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php80                   v1.29.0  Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81                   v1.29.0  Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-php83                   v1.28.0  Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions
symfony/process                          v6.4.4   Executes commands in sub-processes
symfony/psr-http-message-bridge          v6.4.3   PSR HTTP message bridge
symfony/routing                          v6.4.5   Maps an HTTP request to a set of configuration variables
symfony/serializer                       v6.4.4   Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
symfony/service-contracts                v3.4.1   Generic abstractions related to writing services
symfony/string                           v6.4.4   Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/translation-contracts            v3.4.1   Generic abstractions related to translation
symfony/validator                        v6.4.4   Provides tools to validate values
symfony/var-dumper                       v6.4.4   Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter                     v6.4.4   Allows exporting any serializable PHP data structure to plain PHP code
symfony/yaml                             v6.4.3   Loads and dumps YAML files
twig/twig                                v3.8.0   Twig, the flexible, fast, and secure template language for PHP
webflo/drupal-finder                     1.2.2    Helper class to locate a Drupal installation from a given path.
greg-1-anderson commented 5 months ago

Correct, this would need to be supported in consolidation/config and/or consolidation/annotated-command. I have a vague memory of looking into this and discovering that Symfony decided that boolean options do not need default values, destroying our ability to fix this. I don't quite recall, but I think that's why I didn't make any progress here.