|
28 | 28 | */
|
29 | 29 | class DeployStaticContentCommand extends Command
|
30 | 30 | {
|
| 31 | + /** |
| 32 | + * Key for dry-run option |
| 33 | + * @deprecated |
| 34 | + * @see Magento\Deploy\Console\Command\DeployStaticOptionsInterface::DRY_RUN |
| 35 | + */ |
| 36 | + const DRY_RUN_OPTION = 'dry-run'; |
| 37 | + |
| 38 | + /** |
| 39 | + * Key for languages parameter |
| 40 | + * @deprecated |
| 41 | + * @see DeployStaticContentCommand::LANGUAGES_ARGUMENT |
| 42 | + */ |
| 43 | + const LANGUAGE_OPTION = 'languages'; |
| 44 | + |
31 | 45 | /**
|
32 | 46 | * Default language value
|
33 | 47 | */
|
@@ -98,109 +112,109 @@ protected function configure()
|
98 | 112 | ->setDescription('Deploys static view files')
|
99 | 113 | ->setDefinition([
|
100 | 114 | new InputOption(
|
101 |
| - Options::DRY_RUN_OPTION, |
| 115 | + Options::DRY_RUN, |
102 | 116 | '-d',
|
103 | 117 | InputOption::VALUE_NONE,
|
104 | 118 | 'If specified, then no files will be actually deployed.'
|
105 | 119 | ),
|
106 | 120 | new InputOption(
|
107 |
| - Options::FORCE_RUN_OPTION, |
| 121 | + Options::FORCE_RUN, |
108 | 122 | '-f',
|
109 | 123 | InputOption::VALUE_NONE,
|
110 | 124 | 'If specified, then run files will be deployed in any mode.'
|
111 | 125 | ),
|
112 | 126 | new InputOption(
|
113 |
| - Options::JAVASCRIPT_OPTION, |
| 127 | + Options::NO_JAVASCRIPT, |
114 | 128 | null,
|
115 | 129 | InputOption::VALUE_NONE,
|
116 | 130 | 'If specified, no JavaScript will be deployed.'
|
117 | 131 | ),
|
118 | 132 | new InputOption(
|
119 |
| - Options::CSS_OPTION, |
| 133 | + Options::NO_CSS, |
120 | 134 | null,
|
121 | 135 | InputOption::VALUE_NONE,
|
122 | 136 | 'If specified, no CSS will be deployed.'
|
123 | 137 | ),
|
124 | 138 | new InputOption(
|
125 |
| - Options::LESS_OPTION, |
| 139 | + Options::NO_LESS, |
126 | 140 | null,
|
127 | 141 | InputOption::VALUE_NONE,
|
128 | 142 | 'If specified, no LESS will be deployed.'
|
129 | 143 | ),
|
130 | 144 | new InputOption(
|
131 |
| - Options::IMAGES_OPTION, |
| 145 | + Options::NO_IMAGES, |
132 | 146 | null,
|
133 | 147 | InputOption::VALUE_NONE,
|
134 | 148 | 'If specified, no images will be deployed.'
|
135 | 149 | ),
|
136 | 150 | new InputOption(
|
137 |
| - Options::FONTS_OPTION, |
| 151 | + Options::NO_FONTS, |
138 | 152 | null,
|
139 | 153 | InputOption::VALUE_NONE,
|
140 | 154 | 'If specified, no font files will be deployed.'
|
141 | 155 | ),
|
142 | 156 | new InputOption(
|
143 |
| - Options::HTML_OPTION, |
| 157 | + Options::NO_HTML, |
144 | 158 | null,
|
145 | 159 | InputOption::VALUE_NONE,
|
146 | 160 | 'If specified, no html files will be deployed.'
|
147 | 161 | ),
|
148 | 162 | new InputOption(
|
149 |
| - Options::MISC_OPTION, |
| 163 | + Options::NO_MISC, |
150 | 164 | null,
|
151 | 165 | InputOption::VALUE_NONE,
|
152 | 166 | 'If specified, no miscellaneous files will be deployed.'
|
153 | 167 | ),
|
154 | 168 | new InputOption(
|
155 |
| - Options::HTML_MINIFY_OPTION, |
| 169 | + Options::NO_HTML_MINIFY, |
156 | 170 | null,
|
157 | 171 | InputOption::VALUE_NONE,
|
158 |
| - 'If specified, just html will not be minified and actually deployed.' |
| 172 | + 'If specified, html will not be minified.' |
159 | 173 | ),
|
160 | 174 | new InputOption(
|
161 |
| - Options::THEME_OPTION, |
| 175 | + Options::THEME, |
162 | 176 | '-t',
|
163 | 177 | InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
|
164 | 178 | 'If specified, just specific theme(s) will be actually deployed.',
|
165 | 179 | ['all']
|
166 | 180 | ),
|
167 | 181 | new InputOption(
|
168 |
| - Options::EXCLUDE_THEME_OPTION, |
| 182 | + Options::EXCLUDE_THEME, |
169 | 183 | null,
|
170 | 184 | InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
|
171 | 185 | 'If specified, exclude specific theme(s) from deployment.',
|
172 | 186 | ['none']
|
173 | 187 | ),
|
174 | 188 | new InputOption(
|
175 |
| - Options::LANGUAGE_OPTION, |
| 189 | + Options::LANGUAGE, |
176 | 190 | '-l',
|
177 | 191 | InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
|
178 | 192 | 'List of languages you want the tool populate files for.',
|
179 | 193 | ['all']
|
180 | 194 | ),
|
181 | 195 | new InputOption(
|
182 |
| - Options::EXCLUDE_LANGUAGE_OPTION, |
| 196 | + Options::EXCLUDE_LANGUAGE, |
183 | 197 | null,
|
184 | 198 | InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
|
185 | 199 | 'List of langiages you do not want the tool populate files for.',
|
186 | 200 | ['none']
|
187 | 201 | ),
|
188 | 202 | new InputOption(
|
189 |
| - Options::AREA_OPTION, |
| 203 | + Options::AREA, |
190 | 204 | '-a',
|
191 | 205 | InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
|
192 | 206 | 'List of areas you want the tool populate files for.',
|
193 | 207 | ['all']
|
194 | 208 | ),
|
195 | 209 | new InputOption(
|
196 |
| - Options::EXCLUDE_AREA_OPTION, |
| 210 | + Options::EXCLUDE_AREA, |
197 | 211 | null,
|
198 | 212 | InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
|
199 | 213 | 'List of areas you do not want the tool populate files for.',
|
200 | 214 | ['none']
|
201 | 215 | ),
|
202 | 216 | new InputOption(
|
203 |
| - Options::JOBS_AMOUNT_OPTION, |
| 217 | + Options::JOBS_AMOUNT, |
204 | 218 | '-j',
|
205 | 219 | InputOption::VALUE_OPTIONAL,
|
206 | 220 | 'Amount of jobs to which script can be paralleled.',
|
@@ -357,9 +371,7 @@ private function getDeployableEntities($entities, $includedEntities, $excludedEn
|
357 | 371 | */
|
358 | 372 | protected function execute(InputInterface $input, OutputInterface $output)
|
359 | 373 | {
|
360 |
| - if (!$input->getOption(Options::FORCE_RUN_OPTION) |
361 |
| - && $this->getAppState()->getMode() !== State::MODE_PRODUCTION |
362 |
| - ) { |
| 374 | + if (!$input->getOption(Options::FORCE_RUN) && $this->getAppState()->getMode() !== State::MODE_PRODUCTION) { |
363 | 375 | throw new LocalizedException(
|
364 | 376 | __(
|
365 | 377 | "Deploy static content is applicable only for production mode.\n"
|
@@ -423,21 +435,21 @@ private function prepareDeployableEntities($filesUtil)
|
423 | 435 | }
|
424 | 436 | }
|
425 | 437 |
|
426 |
| - $areasInclude = $this->input->getOption(Options::AREA_OPTION); |
427 |
| - $areasExclude = $this->input->getOption(Options::EXCLUDE_AREA_OPTION); |
| 438 | + $areasInclude = $this->input->getOption(Options::AREA); |
| 439 | + $areasExclude = $this->input->getOption(Options::EXCLUDE_AREA); |
428 | 440 | $this->checkAreasInput($magentoAreas, $areasInclude, $areasExclude);
|
429 | 441 | $deployableAreas = $this->getDeployableEntities($magentoAreas, $areasInclude, $areasExclude);
|
430 | 442 |
|
431 | 443 | $languagesInclude = $this->input->getArgument(self::LANGUAGES_ARGUMENT)
|
432 |
| - ?: $this->input->getOption(Options::LANGUAGE_OPTION); |
433 |
| - $languagesExclude = $this->input->getOption(Options::EXCLUDE_LANGUAGE_OPTION); |
| 444 | + ?: $this->input->getOption(Options::LANGUAGE); |
| 445 | + $languagesExclude = $this->input->getOption(Options::EXCLUDE_LANGUAGE); |
434 | 446 | $this->checkLanguagesInput($languagesInclude, $languagesExclude);
|
435 | 447 | $deployableLanguages = $languagesInclude[0] == 'all'
|
436 | 448 | ? $this->getDeployableEntities($magentoLanguages, $languagesInclude, $languagesExclude)
|
437 | 449 | : $languagesInclude;
|
438 | 450 |
|
439 |
| - $themesInclude = $this->input->getOption(Options::THEME_OPTION); |
440 |
| - $themesExclude = $this->input->getOption(Options::EXCLUDE_THEME_OPTION); |
| 451 | + $themesInclude = $this->input->getOption(Options::THEME); |
| 452 | + $themesExclude = $this->input->getOption(Options::EXCLUDE_THEME); |
441 | 453 | $this->checkThemesInput($magentoThemes, $themesInclude, $themesExclude);
|
442 | 454 | $deployableThemes = $this->getDeployableEntities($magentoThemes, $themesInclude, $themesExclude);
|
443 | 455 |
|
@@ -529,10 +541,10 @@ private function isCanBeParalleled()
|
529 | 541 | */
|
530 | 542 | private function getProcessesAmount()
|
531 | 543 | {
|
532 |
| - $jobs = (int)$this->input->getOption(Options::JOBS_AMOUNT_OPTION); |
| 544 | + $jobs = (int)$this->input->getOption(Options::JOBS_AMOUNT); |
533 | 545 | if ($jobs < 1) {
|
534 | 546 | throw new \InvalidArgumentException(
|
535 |
| - Options::JOBS_AMOUNT_OPTION . ' argument has invalid value. It must be greater than 0' |
| 547 | + Options::JOBS_AMOUNT . ' argument has invalid value. It must be greater than 0' |
536 | 548 | );
|
537 | 549 | }
|
538 | 550 | return $jobs;
|
|
0 commit comments