Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeployStaticOptions.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Deploy\Console;
8 
9 use Symfony\Component\Console\Input\InputOption;
10 use Symfony\Component\Console\Input\InputArgument;
11 
19 {
23  const AREA = 'area';
24 
28  const EXCLUDE_AREA = 'exclude-area';
29 
33  const THEME = 'theme';
34 
38  const EXCLUDE_THEME = 'exclude-theme';
39 
43  const LANGUAGE = 'language';
44 
48  const EXCLUDE_LANGUAGE = 'exclude-language';
49 
53  const STRATEGY = 'strategy';
54 
58  const JOBS_AMOUNT = 'jobs';
59 
63  const FORCE_RUN = 'force';
64 
68  const SYMLINK_LOCALE = 'symlink-locale';
69 
73  const NO_JAVASCRIPT = 'no-javascript';
74 
78  const NO_CSS = 'no-css';
79 
83  const NO_FONTS = 'no-fonts';
84 
88  const NO_IMAGES = 'no-images';
89 
93  const NO_HTML = 'no-html';
94 
98  const NO_HTML_MINIFY = 'no-html-minify';
99 
103  const NO_MISC = 'no-misc';
104 
110  const DRY_RUN = 'dry-run';
111 
117  const NO_LESS = 'no-less';
118 
123 
127  const LANGUAGES_ARGUMENT = 'languages';
128 
132  const CONTENT_VERSION = 'content-version';
133 
137  const REFRESH_CONTENT_VERSION_ONLY = 'refresh-content-version-only';
138 
144  public function getOptionsList()
145  {
146  return array_merge($this->getBasicOptions(), $this->getSkipOptions());
147  }
148 
154  private function getBasicOptions()
155  {
156  return [
157  new InputOption(
158  self::FORCE_RUN,
159  '-f',
160  InputOption::VALUE_NONE,
161  'Deploy files in any mode.'
162  ),
163  new InputOption(
164  self::STRATEGY,
165  '-s',
166  InputOption::VALUE_OPTIONAL,
167  'Deploy files using specified strategy.',
168  'quick'
169  ),
170  new InputOption(
171  self::AREA,
172  '-a',
173  InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
174  'Generate files only for the specified areas.',
175  ['all']
176  ),
177  new InputOption(
178  self::EXCLUDE_AREA,
179  null,
180  InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
181  'Do not generate files for the specified areas.',
182  ['none']
183  ),
184  new InputOption(
185  self::THEME,
186  '-t',
187  InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
188  'Generate static view files for only the specified themes.',
189  ['all']
190  ),
191  new InputOption(
192  self::EXCLUDE_THEME,
193  null,
194  InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
195  'Do not generate files for the specified themes.',
196  ['none']
197  ),
198  new InputOption(
199  self::LANGUAGE,
200  '-l',
201  InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
202  'Generate files only for the specified languages.',
203  ['all']
204  ),
205  new InputOption(
206  self::EXCLUDE_LANGUAGE,
207  null,
208  InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
209  'Do not generate files for the specified languages.',
210  ['none']
211  ),
212  new InputOption(
213  self::JOBS_AMOUNT,
214  '-j',
215  InputOption::VALUE_OPTIONAL,
216  'Enable parallel processing using the specified number of jobs.',
217  self::DEFAULT_JOBS_AMOUNT
218  ),
219  new InputOption(
220  self::SYMLINK_LOCALE,
221  null,
222  InputOption::VALUE_NONE,
223  'Create symlinks for the files of those locales, which are passed for deployment, '
224  . 'but have no customizations.'
225  ),
226  new InputOption(
227  self::CONTENT_VERSION,
228  null,
229  InputArgument::OPTIONAL,
230  'Custom version of static content can be used if running deployment on multiple nodes '
231  . 'to ensure that static content version is identical and caching works properly.'
232  ),
233  new InputOption(
234  self::REFRESH_CONTENT_VERSION_ONLY,
235  null,
236  InputOption::VALUE_NONE,
237  'Refreshing the version of static content only can be used to refresh static content '
238  . 'in browser cache and CDN cache.'
239  ),
240  new InputArgument(
241  self::LANGUAGES_ARGUMENT,
242  InputArgument::IS_ARRAY,
243  'Space-separated list of ISO-636 language codes for which to output static view files.'
244  ),
245  ];
246  }
247 
255  private function getSkipOptions()
256  {
257  return [
258  new InputOption(
259  self::NO_JAVASCRIPT,
260  null,
261  InputOption::VALUE_NONE,
262  'Do not deploy JavaScript files.'
263  ),
264  new InputOption(
265  self::NO_CSS,
266  null,
267  InputOption::VALUE_NONE,
268  'Do not deploy CSS files.'
269  ),
270  new InputOption(
271  self::NO_LESS,
272  null,
273  InputOption::VALUE_NONE,
274  'Do not deploy LESS files.'
275  ),
276  new InputOption(
277  self::NO_IMAGES,
278  null,
279  InputOption::VALUE_NONE,
280  'Do not deploy images.'
281  ),
282  new InputOption(
283  self::NO_FONTS,
284  null,
285  InputOption::VALUE_NONE,
286  'Do not deploy font files.'
287  ),
288  new InputOption(
289  self::NO_HTML,
290  null,
291  InputOption::VALUE_NONE,
292  'Do not deploy HTML files.'
293  ),
294  new InputOption(
295  self::NO_MISC,
296  null,
297  InputOption::VALUE_NONE,
298  'Do not deploy files of other types (.md, .jbf, .csv, etc.).'
299  ),
300  new InputOption(
301  self::NO_HTML_MINIFY,
302  null,
303  InputOption::VALUE_NONE,
304  'Do not minify HTML files.'
305  )
306  ];
307  }
308 }