3
3
4
4
use Consolidation \AnnotatedCommand \CommandError ;
5
5
use Consolidation \AnnotatedCommand \CommandData ;
6
+ use Consolidation \AnnotatedCommand \Input \StdinAwareInterface ;
7
+ use Consolidation \AnnotatedCommand \Input \StdinAwareTrait ;
6
8
use Consolidation \OutputFormatters \StructuredData \RowsOfFields ;
7
9
use Consolidation \SiteProcess \Util \Escape ;
8
10
use Drupal \Core \Config \ConfigFactoryInterface ;
20
22
use Symfony \Component \Yaml \Parser ;
21
23
use Webmozart \PathUtil \Path ;
22
24
23
- class ConfigCommands extends DrushCommands
25
+ class ConfigCommands extends DrushCommands implements StdinAwareInterface
24
26
{
27
+ use StdinAwareTrait;
25
28
use ExecTrait;
26
29
27
30
/**
@@ -84,7 +87,6 @@ public function get($config_name, $key = '', $options = ['format' => 'yaml', 'so
84
87
* @param $key The config key, for example "page.front".
85
88
* @param $value The value to assign to the config key. Use '-' to read from STDIN.
86
89
* @option input-format Format to parse the object. Use "string" for string (default), and "yaml" for YAML.
87
- * // A convenient way to pass a multiline value within a backend request.
88
90
* @option value The value to assign to the config key (if any).
89
91
* @hidden-options value
90
92
* @usage drush config:set system.site page.front node
@@ -106,7 +108,7 @@ public function set($config_name, $key, $value = null, $options = ['input-format
106
108
107
109
// Special flag indicating that the value has been passed via STDIN.
108
110
if ($ data === '- ' ) {
109
- $ data = stream_get_contents ( STDIN );
111
+ $ data = $ this -> stdin ()-> contents ( );
110
112
}
111
113
112
114
// Now, we parse the value.
0 commit comments