{"id":17522,"date":"2018-11-29T14:48:22","date_gmt":"2018-11-29T12:48:22","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=17522"},"modified":"2021-02-18T13:25:13","modified_gmt":"2021-02-18T11:25:13","slug":"magento-2-console-commands","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html","title":{"rendered":"How to Work with Console Commands in Magento 2"},"content":{"rendered":"\n<p>In this article you will find a large list of Magento 2.2 console commands; I will briefly describe each of them and how they work. At the end of the article there are answers to frequently asked questions and a step-by-step guide on how to create your own console commands and make a simple.<!--more--><\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/11\/backround-console-commands.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-17530 background\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/11\/backround-console-commands.png\" alt=\"backround console commands\" width=\"1110\" height=\"300\" title=\"How to Work with Console Commands in Magento 2\"><\/a><br>\nGroups of commands mentioned in this article:<\/p>\n<p><a href=\"#step_1\">help<br>\n<\/a><a href=\"#step_2\">list<br>\n<\/a><a href=\"#step_3\">admin:user<br>\n<\/a><a href=\"#step_4\">catalog<br>\n<\/a><a href=\"#step_5\">config<br>\n<\/a><a href=\"#step_6\">cron<br>\n<\/a><a href=\"#step_7\">customer<br>\n<\/a><a href=\"#step_8\">deploy<br>\n<\/a><a href=\"#step_9\">i18n<br>\n<\/a><a href=\"#step_10\">indexer<br>\n<\/a><a href=\"#step_11\">info<br>\n<\/a><a href=\"#step_12\">maintenance<br>\n<\/a><a href=\"#step_13\">module<br>\n<\/a><a href=\"#step_14\">setup<br>\n<\/a><a href=\"#step_15\">store<br>\n<\/a><a href=\"#step_16\">theme<\/a><br>\n<a href=\"#step_17\">How to create your own console command<br>\n<\/a><a href=\"#step_18\">Creating a progressBar<br>\n<\/a><a href=\"#step_19\">Questions &amp; Answers<\/a><\/p>\n<p><span style=\"font-weight: 400;\">The general command syntax is: <\/span><i><span style=\"font-weight: 400;\">php bin\/magento command<\/span><\/i><\/p>\n<p><i><span style=\"font-weight: 400;\">bin\/magento<\/span><\/i><span style=\"font-weight: 400;\"> refers to Magento 2 CLI Application, and the command is launched via the parent of Magento 2 CLI Application, which is <\/span><i><span style=\"font-weight: 400;\">Symfony\\Component\\Console\\Application<\/span><\/i><span style=\"font-weight: 400;\">. Before that the system adds some default flags: -h | &ndash;help (displays help), -q | &ndash;quiet (nothing will appear at the console), -V | &ndash;version (Magento version). You can increase the level of data output at the console (verbose) starting with -v, and ending with -vvv (debug).<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_1\"><\/a>Help<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">This command allows you to see the syntax of the selected commands, the available options and arguments. For example: <\/span><i><span style=\"font-weight: 400;\">php bin\/magento help setup:upgrade<\/span><\/i><span style=\"font-weight: 400;\">. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this case Magento uses the symfony component: <\/span><i><span style=\"font-weight: 400;\">Symfony\\Component\\Console\\Command\\HelpCommand<\/span><\/i><span style=\"font-weight: 400;\">, which, in its turn, is inherited from <\/span><i><span style=\"font-weight: 400;\">Symfony\\Component\\Console\\Command\\Command<\/span><\/i><span style=\"font-weight: 400;\">. All Magento 2 console commands have one common parent: <\/span><i><span style=\"font-weight: 400;\">Symfony\\Component\\Console\\Command\\Command.<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">Here are the available options:<\/span><\/p>\n<ul>\n<li><i><span style=\"font-weight: 400;\">&ndash;xml <\/span><\/i><span style=\"font-weight: 400;\">displays help as xml (symfony shows, that this option is deprecated in symfony 2.7 version and was deleted in version 3.0). The script overrides the option in <\/span><i><span style=\"font-weight: 400;\">&ndash;format=xml<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;format <\/span><\/i><span style=\"font-weight: 400;\">displays help in any format: txt, xml, json, or md (txt by default).<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;raw <\/span><\/i><span style=\"font-weight: 400;\">displays help without processing.<\/span><\/li>\n<\/ul>\n<p>The command search is carried out by namespace. After that, the script collects all the data about this command: description, name, options, arguments, definitions, and displays it in the specified format.<\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_2\"><\/a>List<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">This command displays a list of available console commands and a brief description of their function.&nbsp;<\/span><span style=\"font-weight: 400;\">It can take a namespace as an argument, for example: list setup.&nbsp;<\/span><span style=\"font-weight: 400;\">Added options: xml, raw, format (you can find the description above, in the <\/span><i><span style=\"font-weight: 400;\">help <\/span><\/i><span style=\"font-weight: 400;\">command paragraph).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By default, the list of commands is displayed in <\/span><i><span style=\"font-weight: 400;\">txt <\/span><\/i><span style=\"font-weight: 400;\">format. However, if you specify the <\/span><i><span style=\"font-weight: 400;\">xml <\/span><\/i><span style=\"font-weight: 400;\">format, you will see a full list of commands with all the possible options, arguments and description. As you can see, each format has a certain amount of information output. The choice of format defines the descriptor that the program will use to collect and display information.<\/span><span style=\"font-weight: 400;\">namespace&nbsp;<em>Symfony\\Component\\Console\\Descriptor.<\/em><\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_3\"><\/a>Admin<\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<h3>admin:user:create<\/h3>\n<p>Let&rsquo;s create a new administrator. Format admin:user:create &ndash;flag value &ndash;flag value&hellip;<\/p>\n<p>Flags:<\/p>\n<ol>\n<li>admin-user (Login)<\/li>\n<li>admin-password (Password)<\/li>\n<li>admin-email (Email)<\/li>\n<li>admin-firstname<\/li>\n<li>admin-lastname<\/li>\n<\/ol>\n<p><em>Username, Firstname, Lastname<\/em> cannot be empty. <em>Email<\/em> should be valid. <em>Password<\/em> should contain more than 7 symbols, including letters and &nbsp;numbers.<\/p>\n<ol>\n<li>When you sett up an account, a password hash and &ldquo;salt&rdquo; (a random string of 32 characters) is generated.\n<ul>\n<li>Hash = php hash(&ldquo;sha256&rdquo;, SaltPassord);<\/li>\n<li>Version = by default HASH_VERSION_LATEST = 1;<\/li>\n<li>PasswordToTheDatabase = Hash:Salt:Version<\/li>\n<\/ul>\n<\/li>\n<li>Account is active by default.<\/li>\n<li>Search for duplication is performed.<\/li>\n<li>username and email are compared.<\/li>\n<li>If matches are found:\n<ul>\n<li>it is verified that the password is not empty;<\/li>\n<li>password should not match username;<\/li>\n<li>if the email matches and the username is different, then an exception is displayed with an error;<\/li>\n<li>if the username matches, and the email is different, then an exception is displayed with an error;<\/li>\n<li>firstname, lastname and password are refreshed, the date is modified.<\/li>\n<\/ul>\n<\/li>\n<li>If the specified user does not exist, a new administrator is created..<\/li>\n<\/ol>\n<p>A new entry is added to the<em> admin_passwords table: user_id, password_hash = p., last_updated = time()<\/em>.<\/p>\n<h3>admin:user:unlock<\/h3>\n<p><span style=\"font-weight: 400;\">The command unlocks the user who has exceeded the limit of admissible errors when entering the admin panel.&nbsp;<\/span><span style=\"font-weight: 400;\">You should specify the username as an argument. The system checks if such a user exists in the <\/span><i><span style=\"font-weight: 400;\">admin_user<\/span><\/i><span style=\"font-weight: 400;\"> table. Next, the user is assigned with the following features:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&lsquo;failures_num&rsquo; =&gt; 0, <\/span><\/li>\n<li><span style=\"font-weight: 400;\">&lsquo;first_failure&rsquo; =&gt; null, <\/span><\/li>\n<li><span style=\"font-weight: 400;\">&lsquo;lock_expires&rsquo; =&gt; null<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The user is considered to be unblocked<\/span><\/p>\n<h3>app:config:dump<\/h3>\n<p><span style=\"font-weight: 400;\">Places the specified configuration type in <\/span><i><span style=\"font-weight: 400;\">app\/etc\/config.php <\/span><\/i><span style=\"font-weight: 400;\">and in <\/span><i><span style=\"font-weight: 400;\">app\/etc\/env.php<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3>app:config:import<\/h3>\n<p><span style=\"font-weight: 400;\">Imports configuration files <\/span><i><span style=\"font-weight: 400;\">config.php<\/span><\/i><span style=\"font-weight: 400;\"> &amp; <\/span><i><span style=\"font-weight: 400;\">env.php<\/span><\/i><span style=\"font-weight: 400;\"> to the database.<\/span><\/p>\n<h3>app:config:status<\/h3>\n<p><span style=\"font-weight: 400;\">Checks if configuration files have been changed in deployment.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_4\"><\/a>Catalog<\/h2>\n<\/div>\n<h3>catalog:images:resize<\/h3>\n<p><span style=\"font-weight: 400;\">This one caches images into various sizes specified in the (view.xml) theme. <\/span><span style=\"font-weight: 400;\">This command collects a set of id(entity_id) of all products from the database and sorts them. All items are searched one by one through the repository. If the product is not found, we switch to the next one, otherwise we read the image gallery of the product (not disabled, the path, id, link are recorded).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Each image collects attributes: keep-ratio, background, etc. and passes validation (if the image is a standard placeholder or has already been cached, then it is skipped).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As a result, the information from the <\/span><i><span style=\"font-weight: 400;\">view.xml<\/span><\/i><span style=\"font-weight: 400;\"> theme is read and all the image sizes module = &ldquo;Magento_Catalog&rdquo; are taken. Each picture is resized according to the collected sizes. After configuration, the images are saved in the <\/span><i><span style=\"font-weight: 400;\">pub\/media\/catalog\/product\/cache\/pathtothepicture<\/span><\/i><span style=\"font-weight: 400;\"> folder.<\/span><\/p>\n<h3>catalog:product:attributes:cleanup<\/h3>\n<p><span style=\"font-weight: 400;\">The command searches for unused attributes of the product (text, varchar, integer, decimal, datetime) and deletes them.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_5\"><\/a>Config<\/h2>\n<\/div>\n<h3>config:sensitive:set<\/h3>\n<p><span style=\"font-weight: 400;\">After executing the <\/span><i><span style=\"font-weight: 400;\">app:config:dump<\/span><\/i><span style=\"font-weight: 400;\"> command, the sensitive system configuration appears in the <\/span><i><span style=\"font-weight: 400;\">app\/etc\/config.php<\/span><\/i><span style=\"font-weight: 400;\"> file. This <\/span><i><span style=\"font-weight: 400;\">CONFIG__*<\/span><\/i><span style=\"font-weight: 400;\"> configuration can be changed with the help of this command.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When a command is created, two arguments are generated for the input: <\/span><i><span style=\"font-weight: 400;\">path <\/span><\/i><span style=\"font-weight: 400;\">(the path to the configuration) and <\/span><i><span style=\"font-weight: 400;\">value <\/span><\/i><span style=\"font-weight: 400;\">(configuration value). Also, the following options are available:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&ndash;interactive<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;scope<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;scope-code<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">After that, the command checks if the changes in the deployment configuration of the system (the hashes are compared) were made.&nbsp;<\/span><span style=\"font-weight: 400;\">The pattern of the search is: <\/span><i><span style=\"font-weight: 400;\">\\s+\\*\\s+(?P&lt;placeholder&gt;CONFIG__.*?)\\s<\/span><\/i><span style=\"font-weight: 400;\">, if the <\/span><i><span style=\"font-weight: 400;\">placeholder <\/span><\/i><span style=\"font-weight: 400;\">group is not found, then the command is interrupted. Instead it may find a path like this: <\/span><i><span style=\"font-weight: 400;\">CONFIG__DEFAULT__SOME__CONF__PATH_ONE<\/span><\/i><span style=\"font-weight: 400;\">. Next, the script processes the string and we get the <\/span><i><span style=\"font-weight: 400;\">default\/some\/conf\/path_one<\/span><\/i><span style=\"font-weight: 400;\">as path as a result. We leave <\/span><i><span style=\"font-weight: 400;\">default\/<\/span><\/i><span style=\"font-weight: 400;\"> aside and get the following variable:&nbsp;<\/span><\/p>\n<pre class=\"lang:default decode:true \"> $configs[&lsquo;some\/conf\/path_one&rsquo;] = &lsquo;CONFIG__DEFAULT__SOME__CONF__PATH_ONE&rsquo;<\/pre>\n<h3>config:set<\/h3>\n<p><span style=\"font-weight: 400;\">The command sets new value for one of the database settings: either <\/span><i><span style=\"font-weight: 400;\">config.php<\/span><\/i><span style=\"font-weight: 400;\"> or <\/span><i><span style=\"font-weight: 400;\">env.php<\/span><\/i><span style=\"font-weight: 400;\">, depending on the specified flags.<\/span><\/p>\n<h3>config:show<\/h3>\n<p><span style=\"font-weight: 400;\">The command shows the configuration value depending on the installed flags and the specified config path.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_6\"><\/a>Cron<\/h2>\n<\/div>\n<h3>cron:install<\/h3>\n<p><span style=\"font-weight: 400;\">Installs in <\/span><i><span style=\"font-weight: 400;\">crontab <\/span><\/i><span style=\"font-weight: 400;\">the launch of <\/span><i><span style=\"font-weight: 400;\">cron.php magento<\/span><\/i><span style=\"font-weight: 400;\">.&nbsp;<\/span><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">&ndash;force | -f <\/span><\/i><span style=\"font-weight: 400;\">option is installed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This command won&rsquo;t work for Windows. If cron has already been installed (crontab -l + preg_match) and the <\/span><i><span style=\"font-weight: 400;\">-f <\/span><\/i><span style=\"font-weight: 400;\">flag hasn&rsquo;t, then the execution of the command will be aborted. Otherwise, we read the tasks (they are assigned in the <\/span><i><span style=\"font-weight: 400;\">Module_Cron\/etc\/di.xml<\/span><\/i><span style=\"font-weight: 400;\"> file).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If <\/span><i><span style=\"font-weight: 400;\">cron:install<\/span><\/i><span style=\"font-weight: 400;\"> has already been executed, then the old task are deleted and new values are set instead.<\/span><\/p>\n<h3>cron:remove<\/h3>\n<p><span style=\"font-weight: 400;\">This command won&rsquo;t work for Windows.&nbsp;<\/span><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">crontab(crontab -l)<\/span><\/i><span style=\"font-weight: 400;\"> content associated with this copy of Magento 2 is read and deleted <\/span><i><span style=\"font-weight: 400;\">(preg_replace)<\/span><\/i><span style=\"font-weight: 400;\">. The result is then rewritten in <\/span><i><span style=\"font-weight: 400;\">crontab<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3>cron:run<\/h3>\n<p><span style=\"font-weight: 400;\">The command forcibly launches cron. The available options are:<\/span><\/p>\n<ul>\n<li><i><span style=\"font-weight: 400;\">&ndash;group<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; runs only a specific group of cron commands;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;bootstrap<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; adds or rewrites bootstrap parameters.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Initially, you need to set cron parameters, such as:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">MAGE_RUN_CODE = admin<\/span><\/li>\n<li><span style=\"font-weight: 400;\">custom_entry_point = true<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Specified group, bootstrap parameters, etc.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> Process:<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">Further, <\/span><i><span style=\"font-weight: 400;\">event default<\/span><\/i><span style=\"font-weight: 400;\"> is launched, we can see <\/span><i><span style=\"font-weight: 400;\">observer Magento\\Cron\\Observer\\ProcessCronQueueObserver<\/span><\/i><span style=\"font-weight: 400;\"> through <\/span><i><span style=\"font-weight: 400;\">event.xml<\/span><\/i><span style=\"font-weight: 400;\">. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">We get the list of all <\/span><i><span style=\"font-weight: 400;\">jobs.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">If a group is specified in the options, then the remaining processes with another group are removed and we divide the groups with the <\/span><i><span style=\"font-weight: 400;\">&ldquo;use_separate_process&rdquo;<\/span><\/i><span style=\"font-weight: 400;\"> configuration into separate processes. If the process is separate, then we launch the group in a separate process via <\/span><i><span style=\"font-weight: 400;\">php cron:run<\/span><\/i><span style=\"font-weight: 400;\">&hellip;<\/span><\/li>\n<li><span style=\"font-weight: 400;\">We block the group for a restart, and after the cron is completed, we clear <\/span><i><span style=\"font-weight: 400;\">jobs <\/span><\/i><span style=\"font-weight: 400;\">(old records), add a new schedule into <\/span><i><span style=\"font-weight: 400;\">cron_schedule<\/span><\/i><span style=\"font-weight: 400;\"> and save the status of script execution. We also try to start the next <\/span><i><span style=\"font-weight: 400;\">job <\/span><\/i><span style=\"font-weight: 400;\">of the selected group which has the <\/span><i><span style=\"font-weight: 400;\">pending <\/span><\/i><span style=\"font-weight: 400;\">status.<\/span><\/li>\n<\/ol>\n<div class=\"h2text\">\n<h2><a id=\"step_7\"><\/a>customer:hash:upgrade<\/h2>\n<\/div>\n<p><span style=\"font-weight: 400;\">Updates the client hash by the latest algorithm.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_8\"><\/a>Deploy<\/h2>\n<\/div>\n<h3>deploy:mode:set<\/h3>\n<p><span style=\"font-weight: 400;\">The command sets the deploy mode of the application: developer or production.<\/span><\/p>\n<h3>deploy:mode:show<\/h3>\n<p><span style=\"font-weight: 400;\">The command shows how the application deploy mode is installed.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_9\"><\/a>i18n<\/h2>\n<\/div>\n<h3>i18n:collect-phrases<\/h3>\n<p><span style=\"font-weight: 400;\">The command collects the phrases from the specified path into a <\/span><i><span style=\"font-weight: 400;\">.csv<\/span><\/i><span style=\"font-weight: 400;\"> file. It comes of handy when you need to collect a set of phrases for translation and hand them over to a translator.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">directory <\/span><\/i><span style=\"font-weight: 400;\">argument specifies the path for collecting language phrases (no need to specify if the <\/span><i><span style=\"font-weight: 400;\">&ndash;magento <\/span><\/i><span style=\"font-weight: 400;\">option is installed).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Available options:<\/span><\/p>\n<ul>\n<li><i><span style=\"font-weight: 400;\">&ndash;output | -o<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; the path for unloading the collected <\/span><i><span style=\"font-weight: 400;\">filename.csv <\/span><\/i><span style=\"font-weight: 400;\">phrases;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;magento | -m<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; the flag automatically connects the entire directory of modules and directories with themes (luma, blank, backend), including custom <\/span><i><span style=\"font-weight: 400;\">app\/design\/&hellip;<\/span><\/i><\/li>\n<\/ul>\n<h3>i18n:pack<\/h3>\n<p><span style=\"font-weight: 400;\">As you&rsquo;ve for the phrases collected and translated by the <\/span><i><span style=\"font-weight: 400;\">i18n:collect-phrases<\/span><\/i><span style=\"font-weight: 400;\"> command, &nbsp;launch this command and a translation will be created in <\/span><i><span style=\"font-weight: 400;\">moduleFolder\/i18n\/specifiedLocal.<\/span><\/i><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_10\"><\/a>Indexer<\/h2>\n<\/div>\n<h3>indexer:info<\/h3>\n<p><span style=\"font-weight: 400;\">The command outputs the list of indices to the console: id and name.<\/span><\/p>\n<h3>indexer:reindex<\/h3>\n<p><span style=\"font-weight: 400;\">Reset and rebuild indices. Either all of them, or only the specified ones. They are collected so that later you can faster obtain basic information and are store it in separate tables.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Available indices:<\/span><\/p>\n<ul>\n<li><em>design_config_grid<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles the design configuration list (<\/span><em><span style=\"font-weight: 400;\">Admin &gt; Content &gt; Design &gt; Configuration<\/span><\/em><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><em>customer_grid<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles the client list in the admin panel (<\/span><em><span style=\"font-weight: 400;\">Admin &gt; Customers &gt; All customers<\/span><\/em><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><em>catalog_category_product<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles the binding index of a category to a product;<\/span><\/li>\n<li><em>catalog_product_category<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles the binding index of a product to a category (almost identical to <\/span><i><span style=\"font-weight: 400;\">catalog_category_product<\/span><\/i><span style=\"font-weight: 400;\">, the only difference is that the cache is cleared not only by the <\/span><i><span style=\"font-weight: 400;\">&lsquo;cat_c&rsquo; <\/span><\/i><span style=\"font-weight: 400;\">tag, but also by the <\/span><i><span style=\"font-weight: 400;\">&lsquo;cat_p&rsquo;<\/span><\/i><span style=\"font-weight: 400;\"> tag. After that, both indices are considered assembled);<\/span><\/li>\n<li><em>catalogrule_rule<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles only the index of Catalog Price rules;<\/span><\/li>\n<li><em>catalog_product_attribute<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles the attribute-to-product ratio collection;<\/span><\/li>\n<li><em>cataloginventory_stock<\/em><span style=\"font-weight: 400;\"> &mdash; product availability;<\/span><\/li>\n<li><em>catalog_product_price<\/em><span style=\"font-weight: 400;\"> &mdash; reassembles the ratio of prices and goods;<\/span><\/li>\n<li><em>catalogrule_product<\/em><span style=\"font-weight: 400;\"> &mdash; saves the suitable products by Catalog Price rule;<\/span><\/li>\n<li><em>catalogsearch_fulltext<\/em><span style=\"font-weight: 400;\"> &mdash; search queries.<\/span><\/li>\n<\/ul>\n<h3>indexer:reset<\/h3>\n<p><span style=\"font-weight: 400;\">The command sets the indices status to <\/span><i><span style=\"font-weight: 400;\">invalid<\/span><\/i><span style=\"font-weight: 400;\">. If you did not specify an index type, then all the indices will be reset, and at the next round cron will rebuild the index.<\/span><\/p>\n<h3>indexer:set-mode<\/h3>\n<p><span style=\"font-weight: 400;\">Specifies the (realtime|schedule) mode and the index type. If specified according to the schedule, then the <\/span><i><span style=\"font-weight: 400;\">enabled <\/span><\/i><span style=\"font-weight: 400;\">value will be recorded to the <\/span><i><span style=\"font-weight: 400;\">mview_state<\/span><\/i><span style=\"font-weight: 400;\"> table.<\/span><\/p>\n<h3>indexer:show-mode<\/h3>\n<p><span style=\"font-weight: 400;\">In the admin panel you can configure how certain indices will be updated. There are two options: either to update the indices on schedule, or to update them together with updating the records. Using this command, you can view the current index update. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The command reads the data from the <\/span><i><span style=\"font-weight: 400;\">mview_state<\/span><\/i><span style=\"font-weight: 400;\"> table. If the value is enabled, then &ldquo;Update by Schedule&rdquo; is displayed, otherwise &mdash; &ldquo;Update on Save&rdquo;.<\/span><\/p>\n<h3>indexer:status<\/h3>\n<p><span style=\"font-weight: 400;\">The command shows indices list and index status.&nbsp;<\/span><span style=\"font-weight: 400;\">It makes a table with the following columns: Title, Status, Update On, Schedule Status, Schedule Updated. <\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">Title &mdash; index name.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Status &mdash; takes the value from <\/span><i><span style=\"font-weight: 400;\">indexer_state<\/span><\/i><span style=\"font-weight: 400;\"> table.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Update On &mdash; takes the value from the <\/span><i><span style=\"font-weight: 400;\">mview_state <\/span><\/i><span style=\"font-weight: 400;\">table, if enabled &mdash; Schedule, otherwise &mdash; Save.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Schedule Status &mdash; if updated on schedule, then displays the <\/span><i><span style=\"font-weight: 400;\">&ldquo;pendingCount in backlog&rdquo;<\/span><\/i><span style=\"font-weight: 400;\"> string. <\/span><i><span style=\"font-weight: 400;\">pendingCount <\/span><\/i><span style=\"font-weight: 400;\">= the number of records from the <\/span><i><span style=\"font-weight: 400;\">{index}_cl<\/span><\/i><span style=\"font-weight: 400;\"> table, where the version = the version in the <\/span><i><span style=\"font-weight: 400;\">mview_state<\/span><\/i><span style=\"font-weight: 400;\"> table.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Schedule Updated &mdash; mview_state (column with data &mdash; updated)<\/span><\/li>\n<\/ol>\n<div class=\"h2text\">\n<h2><a id=\"step_11\"><\/a>Info<\/h2>\n<\/div>\n<h3>info:adminuri<\/h3>\n<p><span style=\"font-weight: 400;\">The command displays the path (incomplete) to the admin panel. Reads the data from <\/span><i><span style=\"font-weight: 400;\">app\/etc\/env.php<\/span><\/i><span style=\"font-weight: 400;\">. <\/span><\/p>\n<h3>info:backups:list<\/h3>\n<p><span style=\"font-weight: 400;\">The command displays a list of backups from the <\/span><i><span style=\"font-weight: 400;\">var\/backups<\/span><\/i><span style=\"font-weight: 400;\"> folder as a table:&nbsp;<\/span><span style=\"font-weight: 400;\">&lsquo;Backup Filename&rsquo;, &lsquo;Backup Type&rsquo;<\/span><\/p>\n<h3>info:currency:list<\/h3>\n<p><span style=\"font-weight: 400;\">The command composes a table of allowed currencies from <\/span><i><span style=\"font-weight: 400;\">Currency <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">Code <\/span><\/i><span style=\"font-weight: 400;\">values.&nbsp;<\/span><span style=\"font-weight: 400;\">It takes possible currency names from the <\/span><i><span style=\"font-weight: 400;\">php ResourceBundle(en_US)<\/span><\/i><span style=\"font-weight: 400;\"> class and checks if they were allowed in the admin panel.<\/span><\/p>\n<h3>info:dependencies:show-framework<\/h3>\n<p><span style=\"font-weight: 400;\">The command is similar to<\/span><i><span style=\"font-weight: 400;\"> info:dependencies:show-modules-circular<\/span><\/i><span style=\"font-weight: 400;\">, but it displays the modules that directly depend on <\/span><i><span style=\"font-weight: 400;\">framework<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3>info:dependencies:show-modules<\/h3>\n<p><span style=\"font-weight: 400;\">The command is similar to <\/span><i><span style=\"font-weight: 400;\">info:dependencies:show-modules-circular<\/span><\/i><span style=\"font-weight: 400;\">, but &nbsp;it displays the main dependencies (no tree is build).<\/span><\/p>\n<h3>info:dependencies:show-modules-circular<\/h3>\n<p><span style=\"font-weight: 400;\">The command creates a report on how modules depend on each other.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The<\/span><i><span style=\"font-weight: 400;\"> &ndash;output=OUTPUT <\/span><\/i><span style=\"font-weight: 400;\">option is available &mdash; name of the file with the report is <\/span><i><span style=\"font-weight: 400;\">&lsquo;modules-circular-dependencies.csv&rsquo; <\/span><\/i><span style=\"font-weight: 400;\">by default. <\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">The command searches for the registered modules (ComponentRegistrar::MODULE) and reads <\/span><i><span style=\"font-weight: 400;\">composer.json<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Reassemble <\/span><i><span style=\"font-weight: 400;\">composer.json<\/span><\/i><span style=\"font-weight: 400;\"> and create a new <\/span><i><span style=\"font-weight: 400;\">Package(json_decode(file_get_contents($file)))<\/span><\/i><span style=\"font-weight: 400;\"> package from each one.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The dependencies are assembled.<\/span><\/li>\n<\/ol>\n<h3>info:language:list<\/h3>\n<p><span style=\"font-weight: 400;\">The command makes a table of the allowed currencies from <\/span><i><span style=\"font-weight: 400;\">Language <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">Code <\/span><\/i><span style=\"font-weight: 400;\">values.&nbsp;<\/span><span style=\"font-weight: 400;\">The values are taken from <\/span><i><span style=\"font-weight: 400;\">php LanguageBundle <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">RegionBundle <\/span><\/i><span style=\"font-weight: 400;\">classes and displayed in <\/span><i><span style=\"font-weight: 400;\">en_US<\/span><\/i><span style=\"font-weight: 400;\">. &nbsp;<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">Read the list of languages (locale) from the <\/span><i><span style=\"font-weight: 400;\">php ResourceBundle::getLocales() <\/span><\/i><span style=\"font-weight: 400;\">class.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the locale is allowed in the admin panel, then we display in the table the values of the language and country for it.<\/span><\/li>\n<\/ol>\n<h3>info:timezone:list<\/h3>\n<p><span style=\"font-weight: 400;\">The command makes a table of time zones from values <\/span><i><span style=\"font-weight: 400;\">Timezone<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">Code<\/span><\/i><span style=\"font-weight: 400;\">. Values are taken from the <\/span><i><span style=\"font-weight: 400;\">php DateTimeZone<\/span><\/i><span style=\"font-weight: 400;\"> class.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_12\"><\/a>Maintenance<\/h2>\n<\/div>\n<h3>maintenance:allow-ips<\/h3>\n<p><span style=\"font-weight: 400;\">The command provides access to the site to the specified IP addresses if the maintenance mode is enabled.&nbsp;<\/span><span style=\"font-weight: 400;\">The IP address is taken as an argument; if there are several IP addresses, separate them with spaces.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Options:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&ndash;none<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;add<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If the specified option is <\/span><i><span style=\"font-weight: 400;\">&ndash;none<\/span><\/i><span style=\"font-weight: 400;\">, then the list of allowed ip-addresses will be cleared. All the specified IP addresses are validated, and if the validation is successful and the IP addresses are specified, then the IP addresses are recorded separated by comma. If the <\/span><i><span style=\"font-weight: 400;\">&ndash;add <\/span><\/i><span style=\"font-weight: 400;\">option was not specified, the old entries will be erased.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">IP addresses are stored in <\/span><i><span style=\"font-weight: 400;\">var\/.maintenance.ip<\/span><\/i><span style=\"font-weight: 400;\"> file. If IP addresses are not specified and there are no old entries, the file is deleted.<\/span><\/p>\n<h3>maintenance:disable<\/h3>\n<p><span style=\"font-weight: 400;\">The command disables maintenance mode.&nbsp;<\/span><span style=\"font-weight: 400;\">It is similar to the <\/span><i><span style=\"font-weight: 400;\">maintenance:enable<\/span><\/i><span style=\"font-weight: 400;\"> command, the only difference is that <\/span><i><span style=\"font-weight: 400;\">var\/.maintenance.flag<\/span><\/i><span style=\"font-weight: 400;\"> file is deleted.<\/span><\/p>\n<h3>maintenance:enable<\/h3>\n<p><span style=\"font-weight: 400;\">The command enables the maintenance mode.&nbsp;<\/span><span style=\"font-weight: 400;\">The same actions are performed as in the <\/span><i><span style=\"font-weight: 400;\">maintenance:allow-ips<\/span><\/i><span style=\"font-weight: 400;\"> command and IP addresses can be specified using the <\/span><i><span style=\"font-weight: 400;\">&ndash;ip <\/span><\/i><span style=\"font-weight: 400;\">option. Afterwards the command enables Maintenance (a <\/span><i><span style=\"font-weight: 400;\">var\/.maintenance.flag<\/span><\/i><span style=\"font-weight: 400;\"> file is created).<\/span><\/p>\n<h3>maintenance:status<\/h3>\n<p><span style=\"font-weight: 400;\">The command displays <\/span><i><span style=\"font-weight: 400;\">maintenance mode<\/span><\/i><span style=\"font-weight: 400;\"> status. If the <\/span><i><span style=\"font-weight: 400;\">var\/.maintenance.flag<\/span><\/i><span style=\"font-weight: 400;\"> file exists, then the user sees <\/span><i><span style=\"font-weight: 400;\">Status: maintenance mode is active<\/span><\/i><span style=\"font-weight: 400;\">, otherwise &mdash; <\/span><i><span style=\"font-weight: 400;\">not active<\/span><\/i><span style=\"font-weight: 400;\">.&nbsp;<\/span><span style=\"font-weight: 400;\">It also displays allowed IP addresses separated by a space (taken from the <\/span><i><span style=\"font-weight: 400;\">var\/.maintenance.ip<\/span><\/i><span style=\"font-weight: 400;\"> file).<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_13\"><\/a>Module<\/h2>\n<\/div>\n<h3>module:disable<\/h3>\n<p><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;all <\/span><\/i><span style=\"font-weight: 400;\">flag is set, then we get a list of available modules, or indicate the specific list of modules separated by space. The <\/span><i><span style=\"font-weight: 400;\">&ndash;magento-init-params<\/span><\/i><span style=\"font-weight: 400;\"> flag is available (allows to add parameters to customize M2).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For example: MAGE_MODE=developer&amp;MAGE_DIRS[base][path]=\/var\/www\/example.com&amp;MAGE_DIRS[cache][path]=\/var\/tmp\/cache<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Steps:<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">The statuses of all system modules are collected and compared with the status of the modules that we have indicated. If the specified module is currently enabled, it is included in shutdown list. If the module is absent, an exception with an error is displayed and the command execution stops.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the shutdown list is not empty, the script continues.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Next the presence of the <\/span><i><span style=\"font-weight: 400;\">&ndash;force <\/span><\/i><span style=\"font-weight: 400;\">flag (it&rsquo;s not recommended to use) is checked. With the help of this flag, you can forcibly disable the system module, which other modules of the system depend on.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The disabled(0) status is recorded into the <\/span><i><span style=\"font-weight: 400;\">etc\/config.php<\/span><\/i><span style=\"font-weight: 400;\"> file for specified modules.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">opcache_invalidate<\/span><\/i><span style=\"font-weight: 400;\"> function exists, then cache of the <\/span><i><span style=\"font-weight: 400;\">etc\/<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">var\/cache\/mage <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">generated\/code generated\/metadata <\/span><\/i><span style=\"font-weight: 400;\">folder is cleared.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;clear-static-content<\/span><\/i><span style=\"font-weight: 400;\"> flag is specified, then <\/span><i><span style=\"font-weight: 400;\">static <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">var\/view_preprocessed<\/span><\/i><span style=\"font-weight: 400;\"> folders are cleared. And finally, the modification time is set for the <\/span><i><span style=\"font-weight: 400;\">\/var\/.regenerate<\/span><\/i><span style=\"font-weight: 400;\"> file (if not, it is created) using the <\/span><i><span style=\"font-weight: 400;\">touch <\/span><\/i><span style=\"font-weight: 400;\">command.<\/span><\/p>\n<h3>module:enable<\/h3>\n<p><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;all <\/span><\/i><span style=\"font-weight: 400;\">flag is set, we get a list of the available modules, or specify by hand a specific space-separated list of modules. The <\/span><i><span style=\"font-weight: 400;\">&ndash;magento-init-params<\/span><\/i><span style=\"font-weight: 400;\"> flag is available (it allows you to add parameters for customizing M2. For example: MAGE_MODE=developer&amp;MAGE_DIRS[base][path]=\/var\/www\/example.com&amp;MAGE_DIRS[cache][path]=\/var\/tmp\/cache).<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">The statuses of all system modules are collected and compared with the statuses of the indicated modules. If the specified module is currently turned off, it will be included in the enabling list. If the module is absent, an exception with an error is displayed and the execution of the command is halted.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the enabling list is not empty, the script continues.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Next it&rsquo;s checked if the <\/span><i><span style=\"font-weight: 400;\">&ndash;force <\/span><\/i><span style=\"font-weight: 400;\">flag is present (it&rsquo;s not recommended to use). With the help of this flag, you can forcibly enable the system module. If the <\/span><i><span style=\"font-weight: 400;\">&ndash;force <\/span><\/i><span style=\"font-weight: 400;\">flag is not specified, then it&rsquo;s checked for conflicts with other modules and dependencies. Errors will be displayed with their description and the script will be halted.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The enabled(1) status for the specified modules is written to the <\/span><i><span style=\"font-weight: 400;\">etc\/config.php <\/span><\/i><span style=\"font-weight: 400;\">file.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">opcache_invalidate<\/span><\/i><span style=\"font-weight: 400;\"> function exists, then the cache of the <\/span><i><span style=\"font-weight: 400;\">etc\/ <\/span><\/i><span style=\"font-weight: 400;\">folder is cleared. The cache is also cleared in <\/span><i><span style=\"font-weight: 400;\">var\/cache\/mage<\/span><\/i><span style=\"font-weight: 400;\">,<\/span><i><span style=\"font-weight: 400;\"> generated\/code<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">generated\/metadata<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li>If the <i>&ndash;clear-static-content<\/i> flag is specified, then <i>static <\/i>and <i>var\/view_preprocessed<\/i> folders are cleared. And finally, the modification time is set for the <i>\/var\/.regenerate<\/i> file (if not, it is created) using the <i>touch <\/i>command. The Magento team apparently is planning to delete this function from the 2.1.0 version.<\/li>\n<\/ol>\n<h3>module:status<\/h3>\n<p><span style=\"font-weight: 400;\">Collects the information on modules and compiles the list of enabled modules and the list of disabled modules. If one of the lists is empty, &ldquo;None&rdquo; is displayed.<\/span><\/p>\n<h3>module:uninstall<\/h3>\n<p><span style=\"font-weight: 400;\">When you create a command, the following options are added:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&ndash;remove-data<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;backup-code<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;backup-media<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;backup-db<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Next, the access to the system configuration is checked. The validity of the module is checked by the presence of packages in the installed composers and by the list of the installed modules.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The dependency check is run separately (the system checks whether the removal of the specified module will affect other modules).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If validation is successful, the system checks once again if you are ready to remove the module: &ldquo;You are about to remove code and\/or database tables. Are you sure?[y\/n]&rdquo;.<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">If all requirements are met, the maintenance mode is enabled. In case of an error, the maintenance mode will NOT be disabled.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-code <\/span><\/i><span style=\"font-weight: 400;\">option was specified, a backup of <\/span><i><span style=\"font-weight: 400;\">setup:backup &ndash;backup-code<\/span><\/i><span style=\"font-weight: 400;\"> will be created.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-media <\/span><\/i><span style=\"font-weight: 400;\">option was specified, a backup of <\/span><i><span style=\"font-weight: 400;\">setup:backup &ndash;backup-media<\/span><\/i><span style=\"font-weight: 400;\"> will be created.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-db <\/span><\/i><span style=\"font-weight: 400;\">option was specified, then the <\/span><i><span style=\"font-weight: 400;\">areaCode = &lsquo;adminhtml&rsquo;<\/span><\/i><span style=\"font-weight: 400;\"> variable is set first. A backup of the database will be created in the <\/span><i><span style=\"font-weight: 400;\">sql setup:backup &ndash;backup-db <\/span><\/i><span style=\"font-weight: 400;\">format.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">When a module is deleted, the data is deleted from the Database using the <\/span><i><span style=\"font-weight: 400;\">Uninstall <\/span><\/i><span style=\"font-weight: 400;\">class, which is usually located at <\/span><i><span style=\"font-weight: 400;\">Module\\Setup\\Uninstall.php<\/span><\/i><span style=\"font-weight: 400;\">. If the <\/span><i><span style=\"font-weight: 400;\">&ndash;remove-data <\/span><\/i><span style=\"font-weight: 400;\">flag was specified, it will be deleted automatically (if the database backup option is not specified, error will be displayed). If the flag is not specified, but this directory is present in the module, the script will first ask to confirm the deletion of data using the <\/span><i><span style=\"font-weight: 400;\">Uninstall <\/span><\/i><span style=\"font-weight: 400;\">class.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">At the last stage the module will be removed from the <\/span><i><span style=\"font-weight: 400;\">setup_module <\/span><\/i><span style=\"font-weight: 400;\">table and the <\/span><i><span style=\"font-weight: 400;\">etc\/config.php<\/span><\/i><span style=\"font-weight: 400;\"> file will be corrected. The <\/span><i><span style=\"font-weight: 400;\">composer remove theme<\/span><\/i><span style=\"font-weight: 400;\"> command is executed with the <\/span><i><span style=\"font-weight: 400;\">&ndash;no-update <\/span><\/i><span style=\"font-weight: 400;\">flag. The <\/span><i><span style=\"font-weight: 400;\">generated\/code<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">generated\/metadata<\/span><\/i><span style=\"font-weight: 400;\"> folders are cleared. If the <\/span><i><span style=\"font-weight: 400;\">&ndash;clear-static-content <\/span><\/i><span style=\"font-weight: 400;\">flag was set, then the <\/span><i><span style=\"font-weight: 400;\">pub\/static<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">var\/view_preprocessed<\/span><\/i><span style=\"font-weight: 400;\"> folders are cleared.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_14\"><\/a>Setup<\/h2>\n<\/div>\n<h3>setup:backup<\/h3>\n<p><span style=\"font-weight: 400;\">The command creates code or database backup.&nbsp;<\/span><span style=\"font-weight: 400;\">Available options:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&ndash;code<\/span><\/li>\n<li>&ndash;media<\/li>\n<li>&ndash;db<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If there is no<\/span><i><span style=\"font-weight: 400;\"> install\/date<\/span><\/i><span style=\"font-weight: 400;\"> entry in the <\/span><i><span style=\"font-weight: 400;\">app\/etc\/config.php<\/span><\/i><span style=\"font-weight: 400;\"> file and media or db option is specified, the command is stopped.<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">The site goes into the maintenance mode, and in case of error the mode will be disabled.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Depending on the specified options, the backup of the code, media folder or the database is made.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-code <\/span><\/i><span style=\"font-weight: 400;\">flag was specified, then no backup is created for the following directories:<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\/pub\/media<br>\n<\/span><span style=\"font-weight: 400;\">\/pub\/static<br>\n<\/span><span style=\"font-weight: 400;\">\/var<br>\n<\/span><span style=\"font-weight: 400;\">\/update<br>\n<\/span><span style=\"font-weight: 400;\">\/node_modules<br>\n<\/span><span style=\"font-weight: 400;\">\/.grunt<br>\n<\/span><span style=\"font-weight: 400;\">\/.idea<br>\n<\/span><span style=\"font-weight: 400;\">\/.svn<br>\n<\/span><span style=\"font-weight: 400;\">\/.git<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Backup is placed in the <\/span><i><span style=\"font-weight: 400;\">var\/backups<\/span><\/i><span style=\"font-weight: 400;\"> folder. Before creating a backup, two important commands are written: <\/span><i><span style=\"font-weight: 400;\">set_time_limit(0)<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">ignore_user_abort(true)<\/span><\/i><span style=\"font-weight: 400;\">. Next, a <\/span><i><span style=\"font-weight: 400;\">tar <\/span><\/i><span style=\"font-weight: 400;\">archive of all files is created, with the exception of the above-mentioned files.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-media <\/span><\/i><span style=\"font-weight: 400;\">option was specified, a backup of the code will be created according to the principle described in point 3, but all folders except <\/span><i><span style=\"font-weight: 400;\">pub\/media<\/span><\/i><span style=\"font-weight: 400;\"> will be ignored. <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-db <\/span><\/i><span style=\"font-weight: 400;\">option was specified, then the <\/span><i><span style=\"font-weight: 400;\">areaCode = &lsquo;adminhtml&rsquo; <\/span><\/i><span style=\"font-weight: 400;\">variable is set first. Database backup in sql format will be created according to the principle described in point 3. A backup is created per transaction (beginTransaction &ndash; commitTransaction).<\/span><\/li>\n<\/ul>\n<h3>setup:config:set<\/h3>\n<p><span style=\"font-weight: 400;\">The command creates or modifies deployment config.<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">We compile a list of modules and take away the class with <\/span><i><span style=\"font-weight: 400;\">namespace ModulePath\\Setup\\ConfigOptionsList.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">Record the <\/span><i><span style=\"font-weight: 400;\">\\Magento\\Setup\\Model\\ConfigOptionsList<\/span><\/i><span style=\"font-weight: 400;\"> class to the array with the <\/span><i><span style=\"font-weight: 400;\">setup <\/span><\/i><span style=\"font-weight: 400;\">key.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Read the option config from the <\/span><i><span style=\"font-weight: 400;\">-&gt;getOptions<\/span><\/i><span style=\"font-weight: 400;\"> array (e.g., <\/span><i><span style=\"font-weight: 400;\">cache-backend-redis-server<\/span><\/i><span style=\"font-weight: 400;\"> or <\/span><i><span style=\"font-weight: 400;\">page-cache-redis-db<\/span><\/i><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If value isn&rsquo;t specified for any config, then the default value is set (for example, for <\/span><i><span style=\"font-weight: 400;\">cache-backend-redis-server<\/span><\/i><span style=\"font-weight: 400;\">, the default value is 127.0.0.1).<\/span><\/li>\n<\/ol>\n<h3>setup:cron:run<\/h3>\n<p><span style=\"font-weight: 400;\">The command runs cron in applications <\/span><i><span style=\"font-weight: 400;\">setup <\/span><\/i><span style=\"font-weight: 400;\">and searches for <\/span><i><span style=\"font-weight: 400;\">setup:cronjob<\/span><\/i><span style=\"font-weight: 400;\">. This schedule is created if you install a module via partners extensions.<\/span><\/p>\n<h3>setup:db-data:upgrade<\/h3>\n<p><span style=\"font-weight: 400;\">The command runs <\/span><i><span style=\"font-weight: 400;\">UpgradeData <\/span><\/i><span style=\"font-weight: 400;\">of modules.&nbsp;<\/span><span style=\"font-weight: 400;\">If there is no<\/span><i><span style=\"font-weight: 400;\"> install\/date <\/span><\/i><span style=\"font-weight: 400;\">entry in the <\/span><i><span style=\"font-weight: 400;\">app\/etc\/config.php<\/span><\/i><span style=\"font-weight: 400;\"> file, the command execution is stopped.<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">The command reads data from the <\/span><i><span style=\"font-weight: 400;\">app\/etc\/env|config.php<\/span><\/i><span style=\"font-weight: 400;\"> configs. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Reads database settings and verifies connection.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Checks access to <\/span><i><span style=\"font-weight: 400;\">app\/etc<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">var\/<\/span><\/i><span style=\"font-weight: 400;\"> folders.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The list of modules from <\/span><i><span style=\"font-weight: 400;\">app\/etc\/config.php<\/span><\/i><span style=\"font-weight: 400;\"> is read.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">data-version <\/span><\/i><span style=\"font-weight: 400;\">version is read from the database for each module and <\/span><i><span style=\"font-weight: 400;\">setup_version<\/span><\/i><span style=\"font-weight: 400;\"> is compared. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the module was not previously installed, then <\/span><i><span style=\"font-weight: 400;\">ModuleRoot\/Setup\/InstallData <\/span><\/i><span style=\"font-weight: 400;\">is executed.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">ModuleRoot\/Setup\/UpgradeData <\/span><span style=\"font-weight: 400;\">is executed.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">The new version is recorded in the database &mdash; <\/span><i><span style=\"font-weight: 400;\">data_version <\/span><\/i><span style=\"font-weight: 400;\">(the <\/span><i><span style=\"font-weight: 400;\">setup_module <\/span><\/i><span style=\"font-weight: 400;\">table).<\/span><\/li>\n<\/ol>\n<h3>setup:db-schema:upgrade<\/h3>\n<p><span style=\"font-weight: 400;\">The command launches modules <\/span><i><span style=\"font-weight: 400;\">UpgradeSchema<\/span><\/i><span style=\"font-weight: 400;\">.&nbsp;<\/span><span style=\"font-weight: 400;\">The same actions are performed as in <\/span><i><span style=\"font-weight: 400;\">setup:db-data:upgrade<\/span><\/i><span style=\"font-weight: 400;\">, except for the following points:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">The existence of the <\/span><i><span style=\"font-weight: 400;\">setup_module <\/span><\/i><span style=\"font-weight: 400;\">table and <\/span><i><span style=\"font-weight: 400;\">Core <\/span><\/i><span style=\"font-weight: 400;\">tables is checked before the launch (see the <\/span><i><span style=\"font-weight: 400;\">setup:upgrade <\/span><\/i><span style=\"font-weight: 400;\">command, points 4-8).<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">Schema_version <\/span><\/i><span style=\"font-weight: 400;\">is checked instead <\/span><i><span style=\"font-weight: 400;\">data-version.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">Respectively, the <\/span><i><span style=\"font-weight: 400;\">InstallSchema <\/span><\/i><span style=\"font-weight: 400;\">&amp;&amp; <\/span><i><span style=\"font-weight: 400;\">UpgradeSchema <\/span><\/i><span style=\"font-weight: 400;\">files are executed.<\/span><\/li>\n<\/ul>\n<h3>setup:db:status<\/h3>\n<p><span style=\"font-weight: 400;\">The command checks database schema or database data update is necessary.<\/span><\/p>\n<h3>setup:di:compile<\/h3>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Collects configs to the array: <\/span><i><span style=\"font-weight: 400;\">etc\/:env.php &amp;&amp; config.php<\/span><\/i><span style=\"font-weight: 400;\">. When calling <\/span><i><span style=\"font-weight: 400;\">Magento\\Framework\\App\\ObjectManagerFactory-&gt;create($arguments)<\/span><\/i><span style=\"font-weight: 400;\">, you can also pass a new config, which will overwrite the resulting config. After that, the array of parameters is divided into full paths, for example: <\/span><i><span style=\"font-weight: 400;\">modules\/Magento_Ui or cache_types\/customer_notification<\/span><\/i><span style=\"font-weight: 400;\">. If the <\/span><i><span style=\"font-weight: 400;\">modules <\/span><\/i><span style=\"font-weight: 400;\">array is not found from the result, then it displays an error asking to connect the modules.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Clearing cache. <\/span><i><span style=\"font-weight: 400;\">cache:clean.<\/span><\/i><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The assemble of config continues and an array (<\/span><i><span style=\"font-weight: 400;\">Compiled<\/span><\/i><span style=\"font-weight: 400;\">) of paths and module search templates is created, the path to the <\/span><i><span style=\"font-weight: 400;\">generated\/code, vendor\/magento\/framework, setup\/src <\/span><\/i><span style=\"font-weight: 400;\">folder.<\/span>As a result, we have an array of paths to each module and main system folders.<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now we assemble the <\/span><i><span style=\"font-weight: 400;\">exclude <\/span><\/i><span style=\"font-weight: 400;\">array from the <\/span><i><span style=\"font-weight: 400;\">Test || tests<\/span><\/i><span style=\"font-weight: 400;\"> folders, located in modules, system files and <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now the <\/span><i><span style=\"font-weight: 400;\">exclude <\/span><\/i><span style=\"font-weight: 400;\">patterns are collected from the <\/span><i><span style=\"font-weight: 400;\">exclude <\/span><\/i><span style=\"font-weight: 400;\">array. They look something like this: <\/span><i><span style=\"font-weight: 400;\">&ldquo;#^(?:\/var\/www\/lauftraining\/vendor\/(?:magento\/(?:module-authorization|module-customer|module-require-js|module-backend|module-sales-sequence|module-bundle|module-sales|&hellip;)))\/tests#&rsquo;<\/span><\/i><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Next the generators are collected:<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">proxy_generator;<br>\n<\/span><span style=\"font-weight: 400;\">repository_generator, the paths to the modules are passed as an argument;<br>\n<\/span><span style=\"font-weight: 400;\">extension_attributes_generator;<br>\n<\/span><span style=\"font-weight: 400;\">application_code_generator, the whole <\/span><i><span style=\"font-weight: 400;\">compiled <\/span><\/i><span style=\"font-weight: 400;\">array, <\/span><i><span style=\"font-weight: 400;\">filePattern [&lsquo;php&rsquo; =&gt; &lsquo;\/\\.php$\/&rsquo;]<\/span><\/i><span style=\"font-weight: 400;\"> and the <\/span><i><span style=\"font-weight: 400;\">exclude <\/span><\/i><span style=\"font-weight: 400;\">array are passed as arguments;<br>\n<\/span><span style=\"font-weight: 400;\">interception, the <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array (except <\/span><i><span style=\"font-weight: 400;\">setup\/src<\/span><\/i><span style=\"font-weight: 400;\">) and the <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array (only <\/span><i><span style=\"font-weight: 400;\">generated\/code<\/span><\/i><span style=\"font-weight: 400;\">) are passed as arguments;<br>\n<\/span><span style=\"font-weight: 400;\">area, the <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array is passed as an argument (except <\/span><i><span style=\"font-weight: 400;\">setup\/src<\/span><\/i><span style=\"font-weight: 400;\">);<br>\n<\/span><span style=\"font-weight: 400;\">interception_cache, the <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array is passed as an argument (except <\/span><i><span style=\"font-weight: 400;\">setup\/src<\/span><\/i><span style=\"font-weight: 400;\">);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">7. Clean <\/span><i><span style=\"font-weight: 400;\">var\/cache<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">generated\/metadata.<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">8. Add operations to <\/span><i><span style=\"font-weight: 400;\">taskManager(addOperation)<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; we pass the generator and its arguments, the objects are created from <\/span><i><span style=\"font-weight: 400;\">\\Magento\\Setup\\Module\\Di\\App\\Task\\Operation\\<\/span><\/i><span style=\"font-weight: 400;\"> according to generators names; the collected arguments are also sent there;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">9. The <\/span><i><span style=\"font-weight: 400;\">progressBar <\/span><\/i><span style=\"font-weight: 400;\">is launched and all the collected operations in the <\/span><i><span style=\"font-weight: 400;\">taskManager <\/span><\/i><span style=\"font-weight: 400;\">are executed one by one. Before each operation, a new stage of <\/span><i><span style=\"font-weight: 400;\">progressBar <\/span><\/i><span style=\"font-weight: 400;\">is launched, which displays the information. Run the <\/span><i><span style=\"font-weight: 400;\">doOperation()<\/span><\/i><span style=\"font-weight: 400;\"> method in each operation.<\/span><\/p>\n<ol>\n<li><em>ProxyGenerator<\/em> <span style=\"font-weight: 400;\">retrieves the list of files from the area generator, this is <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array (except <\/span><i><span style=\"font-weight: 400;\">setup\/src<\/span><\/i><span style=\"font-weight: 400;\">), collects <\/span><i><span style=\"font-weight: 400;\">di.xml<\/span><\/i><span style=\"font-weight: 400;\"> files, and then extracts the paths ending with Proxy from the <\/span><i><span style=\"font-weight: 400;\">config\/argument\/item<\/span><\/i><span style=\"font-weight: 400;\"> tag and others. For example, the path <\/span><i><span style=\"font-weight: 400;\">Magento\\Config\\Model\\ResourceModel\\Config\\Data\\Collection\\Proxy<\/span><\/i><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\"><br>\n<\/span><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">There you can see the following lines:<\/span><\/span><\/li>\n<\/ol>\n<pre class=\"lang:default decode:true \">$isClassExists = false;\r\ntry {\r\n\t$isClassExists = class_exists($className);\r\n} catch (\\RuntimeException $e) {\r\n }\r\nif (false === $isClassExists) {\r\n\tif (class_exists($entityName) || interface_exists($entityName)) {\r\n            \tarray_push($filteredEntities, $className);\r\n<\/pre>\n<p><span style=\"font-weight: 400;\">If the class does not exist, then we add it to <\/span><i><span style=\"font-weight: 400;\">filteredEntities <\/span><\/i><span style=\"font-weight: 400;\">array, but then a check is made and the generator returns <\/span><i><span style=\"font-weight: 400;\">true <\/span><\/i><span style=\"font-weight: 400;\">or <\/span><i><span style=\"font-weight: 400;\">false <\/span><\/i><span style=\"font-weight: 400;\">(in our case, it&rsquo;s always false).<\/span><\/p>\n<pre class=\"lang:default decode:true \">foreach ($proxies as $entityName) {\r\n   class_exists($entityName);\r\n}\r\n<\/pre>\n<ol>\n<li style=\"list-style-type: none;\">\n<li><em>RepositoryGenerator<\/em> <span style=\"font-weight: 400;\">first gets a list. The modules&rsquo; files are sorted; .<\/span><i><span style=\"font-weight: 400;\">php<\/span><\/i><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"> and the path should not contain (strpos) generation folders. Then class names are collected, for example:<\/span><\/span><\/li>\n<\/ol>\n<p><i><span style=\"font-weight: 400;\">Magento\\Authorization\\Setup\\AuthorizationFactory<\/span><\/i><span style=\"font-weight: 400;\">. Next, the <\/span><i><span style=\"font-weight: 400;\">di.xml<\/span><\/i><span style=\"font-weight: 400;\"> files from the <\/span><i><span style=\"font-weight: 400;\">Compiled <\/span><\/i><span style=\"font-weight: 400;\">array are collected and a search by the <\/span><i><span style=\"font-weight: 400;\">preference <\/span><\/i><span style=\"font-weight: 400;\">tag is run. If <\/span><i><span style=\"font-weight: 400;\">for <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">type <\/span><\/i><span style=\"font-weight: 400;\">are set, and if <\/span><i><span style=\"font-weight: 400;\">type <\/span><\/i><span style=\"font-weight: 400;\">contains the <\/span><i><span style=\"font-weight: 400;\">RepositoryInterface <\/span><\/i><span style=\"font-weight: 400;\">substring and the <\/span><i><span style=\"font-weight: 400;\">for <\/span><\/i><span style=\"font-weight: 400;\">class has not been declared, then the following class names are compiled: <\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">In &ldquo;type&rdquo; <\/span><i><span style=\"font-weight: 400;\">Repository <\/span><\/i><span style=\"font-weight: 400;\">is changed for <\/span><i><span style=\"font-weight: 400;\">InterfacePersistor<\/span><\/i><span style=\"font-weight: 400;\">, and we get <\/span><i><span style=\"font-weight: 400;\">Magento\\Catalog\\Model\\CategoryInterfacePersistor.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">In &ldquo;type&rdquo; <\/span><i><span style=\"font-weight: 400;\">Repository <\/span><\/i><span style=\"font-weight: 400;\">is changed for <\/span><i><span style=\"font-weight: 400;\">InterfaceFactory<\/span><\/i><span style=\"font-weight: 400;\">, and we get <\/span><i><span style=\"font-weight: 400;\">Magento\\Catalog\\Model\\CategoryInterfaceFactory<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">In &ldquo;type&rdquo; <\/span><i><span style=\"font-weight: 400;\">Repository <\/span><\/i><span style=\"font-weight: 400;\">is changed for <\/span><i><span style=\"font-weight: 400;\">SearchResultInterfaceFactory<\/span><\/i><span style=\"font-weight: 400;\">, and we get <\/span><i><span style=\"font-weight: 400;\">Magento\\Catalog\\Model\\CategorySearchResultInterfaceFactory.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">Afterwards it is checked whether the <\/span><i><span style=\"font-weight: 400;\">class_exists<\/span><\/i><span style=\"font-weight: 400;\"> class was declared from the assembled array, and <\/span><i><span style=\"font-weight: 400;\">true <\/span><\/i><span style=\"font-weight: 400;\">or <\/span><i><span style=\"font-weight: 400;\">false <\/span><\/i><span style=\"font-weight: 400;\">is returned.<\/span><\/li>\n<\/ul>\n<p>3. <em>ServiceDataAttributesGenerator<\/em><\/p>\n<h3>setup:install<\/h3>\n<p><span style=\"font-weight: 400;\">The command installs the Magento application.<\/span><\/p>\n<h3>setup:performance:generate-fixtures<\/h3>\n<p><span style=\"font-weight: 400;\">Options:<\/span><\/p>\n<ul>\n<li><i><span style=\"font-weight: 400;\">&ndash;profile<\/span><\/i><span style=\"font-weight: 400;\"> Specify the path to profile;<\/span><\/li>\n<li><i>&ndash;skip-reindex | -s<\/i> Skip <i>reindex.<\/i><\/li>\n<\/ul>\n<ol>\n<li><span style=\"font-weight: 400;\">The config from the <\/span><i><span style=\"font-weight: 400;\">: xml<\/span><\/i><span style=\"font-weight: 400;\"> profile is read, gets transformed to an array and is written in the variable. The directory <\/span><i><span style=\"font-weight: 400;\">profile\/{previous $this-&gt;config[&lsquo;config&rsquo;][&lsquo;profile&rsquo;][&lsquo;di&rsquo;]<\/span><\/i><span style=\"font-weight: 400;\"> or <\/span><i><span style=\"font-weight: 400;\">&lsquo;..\/..\/config\/di.xml&rsquo;}<\/span><\/i><span style=\"font-weight: 400;\"> is written to the <\/span><i><span style=\"font-weight: 400;\">[&lsquo;config&rsquo;][&lsquo;profile&rsquo;][&lsquo;di&rsquo;] <\/span><\/i><span style=\"font-weight: 400;\">path.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Now we upload the <\/span><i><span style=\"font-weight: 400;\">adminhtml::DiConfig <\/span><\/i><span style=\"font-weight: 400;\">configs and extend them with the connected profile.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Searches for files by the <\/span><i><span style=\"font-weight: 400;\">?*Fixture.php <\/span><\/i><span style=\"font-weight: 400;\">pattern.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Each of the found files is assigned with a type from the<\/span><i><span style=\"font-weight: 400;\"> Magento\\Setup\\Fixtures<\/span><\/i><span style=\"font-weight: 400;\"> folder.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Objects with the specified type and the <\/span><i><span style=\"font-weight: 400;\">Magento\\Setup\\Fixtures\\FixtureModel <\/span><\/i><span style=\"font-weight: 400;\">model are created. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Each type has priority, if the priority is greater than zero, then <\/span><i><span style=\"font-weight: 400;\">fixtures <\/span><\/i><span style=\"font-weight: 400;\">are written to the <\/span><i><span style=\"font-weight: 400;\">fixtures <\/span><\/i><span style=\"font-weight: 400;\">variable, and then, regardless of their priority, to the <\/span><i><span style=\"font-weight: 400;\">fixturesByNames[className]<\/span><\/i><span style=\"font-weight: 400;\"> variable. The priority controls duplication and allows sorting the <\/span><i><span style=\"font-weight: 400;\">fixtures <\/span><\/i><span style=\"font-weight: 400;\">variable by keys (priority).<\/span><\/li>\n<\/ol>\n<h3>setup:rollback<\/h3>\n<p><span style=\"font-weight: 400;\">Options:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&ndash;code-file | -c<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;media-file | -m<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;db-file | -d<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">install\/date<\/span><\/i><span style=\"font-weight: 400;\"> date is not set in the config and the <\/span><i><span style=\"font-weight: 400;\">-m <\/span><\/i><span style=\"font-weight: 400;\">flag or the <\/span><i><span style=\"font-weight: 400;\">-d <\/span><\/i><span style=\"font-weight: 400;\">flag are specified, then the system displays an error that the application is not installed.&nbsp;<\/span><span style=\"font-weight: 400;\">Then the system goes to the <\/span><i><span style=\"font-weight: 400;\">Maintenance <\/span><\/i><span style=\"font-weight: 400;\">mode. In case of an error the specified mode will be disabled. It will also be necessary to further confirm the launch of the script.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In case of the (backup code files) code the following folders will be ignored:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/pub\/media<br>\n<\/span><span style=\"font-weight: 400;\">\/pub\/static<br>\n<\/span><span style=\"font-weight: 400;\">\/var<br>\n<\/span><span style=\"font-weight: 400;\">\/update<br>\n<\/span><span style=\"font-weight: 400;\">\/node_modules<br>\n<\/span><span style=\"font-weight: 400;\">\/.grunt<br>\n<\/span><span style=\"font-weight: 400;\">\/.idea<br>\n<\/span><span style=\"font-weight: 400;\">\/.svn<br>\n<\/span><span style=\"font-weight: 400;\">\/.git<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In case of <\/span><i><span style=\"font-weight: 400;\">media<\/span><\/i><span style=\"font-weight: 400;\">, everything except<\/span><i><span style=\"font-weight: 400;\"> pub\/media<\/span><\/i><span style=\"font-weight: 400;\"> is ignored.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Next, the following parameters are set:<\/span><\/p>\n<ul>\n<li>set_time_limit(0);<\/li>\n<li>ignore_user_abort(true);<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If FTP is configured, files are restored via FTP. As a result, the archive is unpacked and restored to the root directory. This process is similar with the database.<\/span><\/p>\n<h3>setup:static-content:deploy<\/h3>\n<p><span style=\"font-weight: 400;\">Launch options:<\/span><\/p>\n<ul>\n<li><i><span style=\"font-weight: 400;\">-f | &ndash;force<\/span><\/i><span style=\"font-weight: 400;\">. By default false;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">-s | &ndash;strategy<\/span><\/i><span style=\"font-weight: 400;\">. (compact or quick or standard). By default &ldquo;quick&rdquo;.<br>\n<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">-a | &ndash;area<\/span><\/i><span style=\"font-weight: 400;\"> (you can specify which area to deploy: <\/span><i><span style=\"font-weight: 400;\">frontend,<\/span><\/i> <i><span style=\"font-weight: 400;\">adminhtml <\/span><\/i><span style=\"font-weight: 400;\">or <\/span><i><span style=\"font-weight: 400;\">all<\/span><\/i><span style=\"font-weight: 400;\">). &ldquo;<\/span><i><span style=\"font-weight: 400;\">all<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;exclude-area<\/span><\/i><span style=\"font-weight: 400;\"> (you can forbid to deploy any area of <\/span><i><span style=\"font-weight: 400;\">frontend <\/span><\/i><span style=\"font-weight: 400;\">or <\/span><i><span style=\"font-weight: 400;\">adminhtml<\/span><\/i><span style=\"font-weight: 400;\">). &ldquo;<\/span><i><span style=\"font-weight: 400;\">none<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">-t | &ndash;theme<\/span><\/i><span style=\"font-weight: 400;\"> (you can specify which theme to deploy or select &ldquo;all&rdquo;). &ldquo;<\/span><i><span style=\"font-weight: 400;\">all<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;exclude-theme<\/span><\/i><span style=\"font-weight: 400;\"> (you can forbid to deploy any theme). &ldquo;<\/span><i><span style=\"font-weight: 400;\">none<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">-l | &ndash;language<\/span><\/i><span style=\"font-weight: 400;\"> (you can specify which language to deploy or select &ldquo;all&rdquo;). &ldquo;<\/span><i><span style=\"font-weight: 400;\">all<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;exclude-language<\/span><\/i><span style=\"font-weight: 400;\"> (you can forbid to deploy any language). &ldquo;<\/span><i><span style=\"font-weight: 400;\">none<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">-j | &ndash;jobs &mdash;- <\/span><\/i><span style=\"font-weight: 400;\">a maximum number of processes. &ldquo;0&rdquo; is set by default.<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;symlink-locale<\/span><\/i><span style=\"font-weight: 400;\"> is false by default<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;content-version<\/span><\/i><span style=\"font-weight: 400;\"> is NULL by default<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;refresh-content-version-only<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;languages<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-javascript<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-css<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-less<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-images<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-fonts<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-html<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-misc<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<li><i><span style=\"font-weight: 400;\">&ndash;no-html-minify<\/span><\/i><span style=\"font-weight: 400;\"> is false by default;<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">-f <\/span><\/i><span style=\"font-weight: 400;\">flag is not set and the Magento Mode is specified as &ldquo;Developer&rdquo; or &ldquo;Default&rdquo;, the script execution will be stopped, since in these Magento modes, the Static view files are created automatically on demand.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Limitations:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;area <\/span><\/i><span style=\"font-weight: 400;\">option is set and does not equal &ldquo;all&rdquo; and if the <\/span><i><span style=\"font-weight: 400;\">&ndash;exclude-area<\/span><\/i><span style=\"font-weight: 400;\"> option<\/span> <span style=\"font-weight: 400;\">is set and does not equal &ldquo;none&rdquo;, then they cannot be executed together and the script execution is stopped.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;theme <\/span><\/i><span style=\"font-weight: 400;\">option is set and does not equal &ldquo;all&rdquo; and if the <\/span><i><span style=\"font-weight: 400;\">&ndash;exclude-theme<\/span><\/i><span style=\"font-weight: 400;\"> option<\/span> <span style=\"font-weight: 400;\">is set and does not equal &ldquo;none&rdquo;, they cannot be executed together and the script execution is stopped.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;language <\/span><\/i><span style=\"font-weight: 400;\">option is set and does not equal &ldquo;all&rdquo; and if the <\/span><i><span style=\"font-weight: 400;\">&ndash;exclude-language <\/span><\/i><span style=\"font-weight: 400;\">option is set and does not equal &ldquo;none&rdquo;, they cannot be executed together and the script execution is stopped. If a specific language is specified, its existence is checked. If the language is not valid, an error is displayed. You can view the full list of available languages by running the <\/span><i><span style=\"font-weight: 400;\">info:language:list<\/span><\/i><span style=\"font-weight: 400;\"> command.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Deploy process:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">First, the <\/span><i><span style=\"font-weight: 400;\">deploy <\/span><\/i><span style=\"font-weight: 400;\">version is installed, and it equals the value specified in the <\/span><i><span style=\"font-weight: 400;\">&ndash;content-version <\/span><\/i><span style=\"font-weight: 400;\">option (string, not empty), if the option is not specified &mdash; version = <\/span><i><span style=\"font-weight: 400;\">&ldquo;new \\DateTime())-&gt;getTimestamp()&rdquo;<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; the <\/span><i><span style=\"font-weight: 400;\">Unix <\/span><\/i><span style=\"font-weight: 400;\">timestamp (for example, 123134232). It&rsquo;s saved to the <\/span><i><span style=\"font-weight: 400;\">pub\/static\/deployed_version.txt<\/span><\/i><span style=\"font-weight: 400;\"> file. If the <\/span><i><span style=\"font-weight: 400;\">&ndash;refresh-content-version-only <\/span><\/i><span style=\"font-weight: 400;\">option was set and it is true, then the script stops at this step.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A queue is created. Maximum number of processes equals <\/span><i><span style=\"font-weight: 400;\">&ndash;jobs <\/span><\/i><span style=\"font-weight: 400;\">option, i.e. 0 by default.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">deploy <\/span><\/i><span style=\"font-weight: 400;\">strategy is created. The value from the <\/span><i><span style=\"font-weight: 400;\">&ndash;strategy <\/span><\/i><span style=\"font-weight: 400;\">option is used, the default value is &ldquo;quick&rdquo;, the above-mentioned queue is bound.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A list of packages is collected.. <\/span>\n<ol>\n<li style=\"font-weight: 400;\"><i><span style=\"font-weight: 400;\">lib\/web <\/span><\/i><span style=\"font-weight: 400;\">files, except <\/span><i><span style=\"font-weight: 400;\">lib\/web\/css\/docs\/*<\/span><\/i><span style=\"font-weight: 400;\"> (area = base, theme = null, locale = null, module = null, since the files do not relate to the theme, modules or languages).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Module files, the path from the module&rsquo;s root is <\/span><i><span style=\"font-weight: 400;\">\/view\/*\/web\/ (area = (base|adminhtml|frontend)<\/span><\/i><span style=\"font-weight: 400;\">, theme = null, locale = null, module = the required module).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Module files, the path from the module&rsquo;s root is <\/span><i><span style=\"font-weight: 400;\">\/view\/*\/web\/i18n\/* (area = (base|adminhtml|frontend)<\/span><\/i><span style=\"font-weight: 400;\">, theme = null, locale = the directory from i18n, module = the required module).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We get a list of themes (custom and standard) and read the files from folders <\/span><i><span style=\"font-weight: 400;\">ThemeRoot\/web\/*<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">ThemeRoot\/web\/i18n\/*<\/span><\/i><span style=\"font-weight: 400;\"> (respectively, the locale is assigned here).<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Files with the .<\/span><i><span style=\"font-weight: 400;\">less<\/span><\/i><span style=\"font-weight: 400;\"> extension (if the name does not begin with _), will have the extension changed to .<\/span><i><span style=\"font-weight: 400;\">css.<\/span><\/i><span style=\"font-weight: 400;\"> If the package does not have <\/span><i><span style=\"font-weight: 400;\">area || theme || locale<\/span><\/i><span style=\"font-weight: 400;\"> installed, then <\/span><i><span style=\"font-weight: 400;\">package[&lsquo;isVirtual&rsquo;] = true.<\/span><\/i>In general, one package looks like this: {area}\/{theme}\/{locale} =&gt; class Magento\\Deploy\\Package\\Package. Each package has a set of files.<\/li>\n<li style=\"font-weight: 400;\">Next the packages are sorted. If the language is not specified or &ldquo;all&rdquo;, then <i>en_US <\/i>is used. The collected language tags are sorted once again and new packages are collected with the old <i>theme &amp;&amp; area<\/i>, but with a new language label (if the theme of the package is <i>Magento\/base<\/i>, then the package is skipped. Other packages are saved at <i>area\/theme\/locale<\/i>).<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Current theme and its parents are read (for example, such paths can exist for <\/span><i><span style=\"font-weight: 400;\">frontend\/Company\/customtheme<\/span><\/i><span style=\"font-weight: 400;\">: <\/span><i><span style=\"font-weight: 400;\">Magento\/blank<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">Company\/customtheme<\/span><\/i><span style=\"font-weight: 400;\"> (<\/span><i><span style=\"font-weight: 400;\">Magento\/base<\/span><\/i><span style=\"font-weight: 400;\"> is skipped). If the path of the parent theme matches the theme of the package and the area, then packages are created if they do not exist at this path. &nbsp;<\/span><i><span style=\"font-weight: 400;\">isVirtual = default<\/span><\/i><span style=\"font-weight: 400;\"> is assigned.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Packages are divided into those that go to <\/span><i><span style=\"font-weight: 400;\">Delpoy <\/span><\/i><span style=\"font-weight: 400;\">and those that are skipped. Verification is carried out by <\/span><i><span style=\"font-weight: 400;\">language || area || theme <\/span><\/i><span style=\"font-weight: 400;\">options. If the <\/span><i><span style=\"font-weight: 400;\">Skip <\/span><\/i><span style=\"font-weight: 400;\">package is not a parent package of one of the <\/span><i><span style=\"font-weight: 400;\">Deploy <\/span><\/i><span style=\"font-weight: 400;\">packages, this package is removed.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Non-virtual packages are grouped by nesting level. For example: $packages[2][&lsquo;frontend\/belvg&rsquo;].<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All the grouped packages are added to queue and then the <\/span><i><span style=\"font-weight: 400;\">queue-&gt;process()<\/span><\/i><span style=\"font-weight: 400;\"> command is executed.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Packages are sorted if the time from the start of the previous process is less than 400 seconds and there are more packages for deployment. If the maximum number of processes is less than 2, or the current number of deployment processes is less than the maximum allowed (option <\/span><i><span style=\"font-weight: 400;\">-j<\/span><\/i><span style=\"font-weight: 400;\">), the package is sent to deploy (execute). After 3 seconds (sleep 3), package deployment is checked, and if it is, it is removed from the queue. Next, return to the beginning of point 11.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">During the execution, the conflicts with the file names .<\/span><i><span style=\"font-weight: 400;\">less<\/span><\/i><span style=\"font-weight: 400;\"> .<\/span><i><span style=\"font-weight: 400;\">css<\/span><\/i><span style=\"font-weight: 400;\"> are resolved (unless the prohibiting option is set).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If parallelization of processes is allowed (<\/span><i><span style=\"font-weight: 400;\">php pcntl_fork <\/span><\/i><span style=\"font-weight: 400;\">function) and the number of simultaneously allowed processes (the <\/span><i><span style=\"font-weight: 400;\">-j <\/span><\/i><span style=\"font-weight: 400;\">flag) is more than one, then we divide the processes into <\/span><i><span style=\"font-weight: 400;\">parent <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">child<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Files that are prohibited by the following options:<\/span><i><span style=\"font-weight: 400;\"> &ndash;no-images, &ndash;no-less, &ndash;no-html etc <\/span><\/i><span style=\"font-weight: 400;\">are skipped.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Files are written to <\/span><i><span style=\"font-weight: 400;\">pub\/static<\/span><\/i><span style=\"font-weight: 400;\">. If the file has no content, the system tries to replace it with a parent element. As a result, a copy is created from the parent theme for each theme and locale, even if it does not have one of the files.<\/span><\/li>\n<li style=\"font-weight: 400;\">At the end of deploy, the aggregate files <i>requirejs-config <\/i>and <i>requirejs-min-resolver <\/i>are created (if not prohibited by the <i>no-javascript <\/i>option). If <i>pcntl_fork <\/i>is available, all connections are closed.<\/li>\n<\/ol>\n<h3>setup:store-config:set<\/h3>\n<p><span style=\"font-weight: 400;\">Available options:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">&ndash;use-rewrites (0 or 1)<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;base-url (url should start with <\/span><i><span style=\"font-weight: 400;\">http(s)<\/span><\/i><span style=\"font-weight: 400;\"> and should not equal <\/span><i><span style=\"font-weight: 400;\">base_url<\/span><\/i><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;base-url-secure (url should begin with <\/span><i><span style=\"font-weight: 400;\">https <\/span><\/i><span style=\"font-weight: 400;\">and should not equal current <\/span><i><span style=\"font-weight: 400;\">base_url<\/span><\/i><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;use-secure (0 or 1);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;use-secure-admin (0 or 1);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;language (the value must match one of <\/span><i><span style=\"font-weight: 400;\">ResourceBundle::getLocales(&rdquo;)<\/span><\/i><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;timezone (the value must match one of <\/span><i><span style=\"font-weight: 400;\">\\DateTimeZone::listIdentifiers(\\DateTimeZone::ALL)<\/span><\/i><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;currency (the value must be allowed in the admin panel <\/span><em><span style=\"font-weight: 400;\">Stores &gt; Configuration &gt; Currency Setup &gt; Allowed Currencies<\/span><\/em><span style=\"font-weight: 400;\">);<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ndash;admin-use-security-key (0 or 1);<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">All the current values can be viewed in the admin panel <\/span><em><span style=\"font-weight: 400;\">Stores &gt; Configuration &gt; General<\/span><\/em><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">When installing Magento, the installation date is recorded in the <\/span><i><span style=\"font-weight: 400;\">\/app\/etc\/env.php -&gt; install\/date<\/span><\/i><span style=\"font-weight: 400;\"> file. If the date is not set, the script will be suspended.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Options are validated.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">setAreaCode = GLOBAL. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Specified values are sorted one by one and saved.<\/span><\/li>\n<\/ul>\n<h3>setup:uninstall<\/h3>\n<p><span style=\"font-weight: 400;\">When running the command, the script asks the confirmation to delete Magento.<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">The cache is cleaned. (Get a list of the available cache types -&gt;&nbsp;Clean the cache -&gt;&nbsp;Get the INVALIDATE status)<\/span><\/li>\n<li>The database is cleared. (<span style=\"font-weight: 400;\">Read the configuration for connecting to the database at <\/span><i><span style=\"font-weight: 400;\">etc\/env.php -&gt; db\/connection\/default. -&gt;&nbsp;If the connection to the database is successful, then we clear the database: &ldquo;DROP DATABASE IF EXISTS DBNAME; CREATE DATABASE IF NOT EXISTS DBNAME;&rdquo;)<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">The files are deleted:<\/span><\/li>\n<\/ol>\n<ul>\n<li><span style=\"font-weight: 400;\">\/pub\/static\/*<\/span><\/li>\n<li><span style=\"font-weight: 400;\">\/var\/*<\/span><\/li>\n<li><span style=\"font-weight: 400;\">\/app\/etc\/env.php<\/span><\/li>\n<li><span style=\"font-weight: 400;\">\/app\/etc\/config.php<\/span><\/li>\n<\/ul>\n<h3>setup:upgrade<\/h3>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Queries for the available cache types and clears the cache.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Clears the folders (unless the <\/span><b>&ndash;keep-generated<\/b><span style=\"font-weight: 400;\"> flag is set):<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">generated\/code<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">generated\/metadata<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">pub\/static<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">var\/view_preprocessed<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Requests a config to connect to the database, checks the MySQL version, privileges, the existence of the database. <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">setup_module <\/span><\/i><span style=\"font-weight: 400;\">table does not exist, creates it.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Installing core tables:<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Queries to the database<\/span><i><span style=\"font-weight: 400;\"> -&gt; <\/span><\/i><i><span style=\"font-weight: 400;\">startSetup()<\/span><\/i><span style=\"font-weight: 400;\">:<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><b>&ldquo;SET SQL_MODE=&rdquo;&rdquo;<\/b><\/li>\n<li style=\"font-weight: 400;\"><b>&ldquo;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0&rdquo;<\/b><\/li>\n<li style=\"font-weight: 400;\"><b>&ldquo;SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=&rsquo;NO_AUTO_VALUE_ON_ZERO'&rdquo;<\/b><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Creates the following tables if they do not exist:<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Session<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Cache<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Cache_tag<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Flag<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Queries to the database <\/span><i><span style=\"font-weight: 400;\">-&gt; endSetup()<\/span><\/i><span style=\"font-weight: 400;\">:<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><b>&ldquo;SET SQL_MODE=IFNULL(@OLD_SQL_MODE,&rdquo;)&rdquo;<\/b><\/li>\n<li style=\"font-weight: 400;\"><b>&ldquo;SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS=0, 0, 1)&rdquo;<\/b><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We get the list of modules, compare the <\/span><i><span style=\"font-weight: 400;\">schema-version <\/span><\/i><span style=\"font-weight: 400;\">of modules in the <\/span><i><span style=\"font-weight: 400;\">setup_module <\/span><\/i><span style=\"font-weight: 400;\">table, call <\/span><i><span style=\"font-weight: 400;\">Setup\/UpgradeSchema || InstallSchema<\/span><\/i><span style=\"font-weight: 400;\"> in the modules, i.e. we update database tables.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We write the new version. <\/span><i><span style=\"font-weight: 400;\">Then Setup\/Recurring-&gt;install<\/span><\/i><span style=\"font-weight: 400;\"> are called (repeated installations).<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">This was <\/span><span style=\"font-weight: 400;\">installSchema.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Check the access to folders <\/span><i><span style=\"font-weight: 400;\">etc<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">var.<\/span><\/i><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We get the list of modules, compare the <\/span><i><span style=\"font-weight: 400;\">data-version <\/span><\/i><span style=\"font-weight: 400;\">of the modules in the <\/span><i><span style=\"font-weight: 400;\">setup_module <\/span><\/i><span style=\"font-weight: 400;\">table, call <\/span><i><span style=\"font-weight: 400;\">InstallData<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">UpgradeData <\/span><\/i><span style=\"font-weight: 400;\">in the modules.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We collect the data from <\/span><i><span style=\"font-weight: 400;\">etc.php<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">config.php<\/span><\/i><span style=\"font-weight: 400;\"> and look for the <\/span><i><span style=\"font-weight: 400;\">install\/date<\/span><\/i><span style=\"font-weight: 400;\"> key among them.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If the key is set, then the <\/span><i><span style=\"font-weight: 400;\">app:config:import<\/span><\/i><span style=\"font-weight: 400;\"> command is run.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If you run this command without the <\/span><i><span style=\"font-weight: 400;\">keep-generated <\/span><\/i><span style=\"font-weight: 400;\">key and with the PRODUCTION mode enabled, then you will be advised to run a recompilation &mdash; <\/span><i><span style=\"font-weight: 400;\">setup:di:compile<\/span><\/i><span style=\"font-weight: 400;\">, since the folders from point 2 will be cleared.<\/span><\/li>\n<\/ol>\n<div class=\"h2text\">\n<h2><a id=\"step_15\"><\/a>Store<\/h2>\n<\/div>\n<h3>store:list<\/h3>\n<p><span style=\"font-weight: 400;\">It is Magento Module-store that creates this console command. The command draws a table in the console with the following fields:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">ID<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Website ID<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Group ID<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Name<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Code<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Sort Order<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Is Active<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Via &ldquo;<\/span><i><span style=\"font-weight: 400;\">\\Magento\\Store\\Model\\StoreManagerInterface<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; the module requests a list of stores together with the default store and displays it in a table as a list. <\/span><\/p>\n<h3>store:website:list<\/h3>\n<p><span style=\"font-weight: 400;\">Magento Module-store creates this console command. The command draws a table in the console with the following fields:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">ID<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Default Group Id<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Name<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Code<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Sort Order<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Is Default<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Via &ldquo;<\/span><i><span style=\"font-weight: 400;\">\\Magento\\Store\\Api\\WebsiteRepositoryInterface<\/span><\/i><span style=\"font-weight: 400;\">&rdquo; the module requests a list of websites and displays it in a table.&nbsp;<\/span><span style=\"font-weight: 400;\">One Website can contain multiple Stores. Website is at the top of the Magento architecture.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_16\"><\/a>Theme<\/h2>\n<\/div>\n<h3>theme:uninstall<\/h3>\n<p><span style=\"font-weight: 400;\">When creating a class, <\/span><i><span style=\"font-weight: 400;\">$this-&gt;configure() <\/span><\/i><span style=\"font-weight: 400;\">is called:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">The &ldquo;theme:uninstall&rdquo; name is set.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">&ldquo;Uninstalls theme&rdquo; discription.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">backup-code (&ndash;backup-code) <\/span><\/i><span style=\"font-weight: 400;\">is added.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">&ldquo;theme&rdquo;<\/span><\/i><span style=\"font-weight: 400;\"> argument is added (the path to the <\/span><i><span style=\"font-weight: 400;\">area\/vendor\/name <\/span><\/i><span style=\"font-weight: 400;\">theme, for example: <\/span><i><span style=\"font-weight: 400;\">frontend\/Magento\/blank<\/span><\/i><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">&ldquo;clear-static-content&rdquo; <\/span><\/i><span style=\"font-weight: 400;\">argument is added (-c|&ndash;clear-static-content).<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Then, when launching the script the following actions are performed:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The <\/span><i><span style=\"font-weight: 400;\">theme <\/span><\/i><span style=\"font-weight: 400;\">argument is read &mdash; path to the theme.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Checking the specified path to the theme:<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Checking if the path matches the <\/span><i><span style=\"font-weight: 400;\">&ldquo;\/^[^\\\/]+\\\/[^\\\/]+\\\/[^\\\/]+$\/&rdquo;<\/span><\/i><span style=\"font-weight: 400;\"> pattern. If not &mdash; there is a mistake.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The list of composer packages is read.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The list of themes is read.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If the theme is not installed as a composer package, the following message is displayed:<\/span><i><span style=\"font-weight: 400;\"> &ldquo;not installed Composer packages&rdquo;<\/span><\/i><span style=\"font-weight: 400;\">. Additionally, an error is displayed if the theme is not found.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Also, the theme cannot be deleted if: 1) it is used by default in store, website or default config. If it is a parent for another theme or there are package composer dependencies.<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">it is used by default in store, website or default config;<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">it is a parent theme for another theme or there are dependencies of composer packages. <\/span><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">If all conditions are met, the maintenance mode is enabled. In case of an error, the maintenance mode will NOT be disabled.&nbsp;<\/span><span style=\"font-weight: 400;\">If the <\/span><i><span style=\"font-weight: 400;\">&ndash;backup-code <\/span><\/i><span style=\"font-weight: 400;\">flag was specified, a backup of the <\/span><i><span style=\"font-weight: 400;\">setup:backup:code &ndash;backup-code<\/span><\/i><span style=\"font-weight: 400;\"> code is created.&nbsp;<\/span><span style=\"font-weight: 400;\">After the backup is created, the <\/span><i><span style=\"font-weight: 400;\">composer remove theme<\/span><\/i><span style=\"font-weight: 400;\"> command is executed with the <\/span><i><span style=\"font-weight: 400;\">&ndash;no-update <\/span><\/i><span style=\"font-weight: 400;\">flag.&nbsp;<\/span><span style=\"font-weight: 400;\">Finally, the cache is cleared <\/span><i><span style=\"font-weight: 400;\">(cache-&gt;clean())<\/span><\/i><span style=\"font-weight: 400;\"> and if the <\/span><i><span style=\"font-weight: 400;\">&ndash;clear-static-content <\/span><\/i><span style=\"font-weight: 400;\">flag was set, then folders <\/span><i><span style=\"font-weight: 400;\">pub\/static<\/span><\/i><span style=\"font-weight: 400;\"> and <\/span><i><span style=\"font-weight: 400;\">var\/view_preprocessed <\/span><\/i><span style=\"font-weight: 400;\">will be cleared.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_17\"><\/a>How to create your own console command<\/h2>\n<\/div>\n<p><span style=\"font-weight: 400;\">Define <\/span><i><span style=\"font-weight: 400;\">di.xml<\/span><\/i><span style=\"font-weight: 400;\"> (ModuleRootFolder\/etc\/di.xml).<\/span><\/p>\n<pre class=\"lang:default decode:true \">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager\/etc\/config.xsd\"&gt;\r\n&lt;type name=\"Magento\\Framework\\Console\\CommandList\"&gt;\r\n        &lt;arguments&gt;\r\n            &lt;argument name=\"commands\" xsi:type=\"array\"&gt;\r\n                &lt;item name=\"anyName\" xsi:type=\"object\"&gt;Mycompany\\MyModule\\Console\\Myclass&lt;\/item&gt;\r\n            &lt;\/argument&gt;\r\n        &lt;\/arguments&gt;\r\n    &lt;\/type&gt;\r\n&lt;\/config&gt;\r\n<\/pre>\n<p><span style=\"font-weight: 400;\">The config informs the system that a new command with the specified control class has appeared. The name of the command and other parameters are defined in the class.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The class itself:<\/span><\/p>\n<pre class=\"lang:default decode:true \">&lt;?php\r\nnamespace Mycompany\\MyModule\\Console;\r\n\r\nuse Magento\\Framework\\Registry;\r\nuse Symfony\\Component\\Console\\Command\\Command;\r\nuse Symfony\\Component\\Console\\Input\\InputInterface;\r\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\r\n\r\n\r\nabstract class Myclass extends Command\r\n{\r\n    const NAME = &lsquo;myclass:mycommand';\r\n    const DESCRIPTION = &lsquo;Description of command';\r\n\r\n    protected function configure()\r\n    {\r\n        $this-&gt;setName(static::NAME);\r\n        $this-&gt;setDescription(static::DESCRIPTION);\r\n\r\n        \/\/Here we can add any options or arguments to our command.\r\n\r\n        parent::configure();\r\n    }\r\n\r\n    protected function execute(InputInterface $input, OutputInterface $output)\r\n    {\r\n        \/\/Output the message to the console\r\n        $output-&gt;writeln('Start execute ' . static::NAME);\r\n\r\n        \/\/some code\r\n\r\n        $output-&gt;writeln('Finish execute ' . static::NAME);\r\n    }\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400;\">That&rsquo;s it. Our command should appear in the <\/span><i><span style=\"font-weight: 400;\">php bin\/magento list<\/span><\/i><span style=\"font-weight: 400;\"> console.<\/span><\/p>\n<div class=\"h2text\">\n<h2><a id=\"step_18\"><\/a>Creating a progressBar<\/h2>\n<\/div>\n<p><span style=\"font-weight: 400;\">It allows you to track the percentage of your script execution.&nbsp;<\/span><span style=\"font-weight: 400;\">Insert the following code into the <\/span><i><span style=\"font-weight: 400;\">execute()<\/span><\/i><span style=\"font-weight: 400;\"> method of your command (let&rsquo;s take a common unit &mdash; record &ndash; as an example):<\/span><\/p>\n<pre class=\"lang:default decode:true \">$progressBar = $this-&gt;objectManager-&gt;create(\r\n                \\Symfony\\Component\\Console\\Helper\\ProgressBar::class,\r\n                [\r\n                    'output' =&gt; $this-&gt;output,\r\n                    'max' =&gt; (int) the number of records in total, the percentage will be calculated based on this amount\r\n                ]\r\n            );\r\n$progressBar-&gt;setFormat(\r\n      '&lt;info&gt;%message%&lt;\/info&gt; %current%\/%max% [%bar%] %percent:3s%% %elapsed% %memory:6s%'\r\n );\r\n$progressBar-&gt;setMessage('The name of the execution process. It will be displayed in the console as a description.');\r\n$progressBar-&gt;start();\r\n$progressBar-&gt;display();\r\n\r\nforeach(...) {\r\n     $progressBar-&gt;advance(); \/\/Place this call, let's say, inside the cycle, and it will add +1 record to your progress, and the progressBar will display everything accordingly\r\n}\r\n\r\n$progressBar-&gt;finish()\r\n<\/pre>\n<div class=\"h2text\">\n<h2><b><a id=\"step_19\"><\/a>Questions &amp; answers<\/b><\/h2>\n<\/div>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Q: &ndash; What is the difference between <\/span><i><span style=\"font-weight: 400;\">cache:clean <\/span><\/i><span style=\"font-weight: 400;\">and <\/span><i><span style=\"font-weight: 400;\">cache:flush<\/span><\/i><span style=\"font-weight: 400;\">?<br>\n<\/span><span style=\"font-weight: 400;\">A: &ndash; <\/span><i><span style=\"font-weight: 400;\">Cache:clean <\/span><\/i><span style=\"font-weight: 400;\">deletes only the files associated with the cache tag of the specified cache type, while <\/span><i><span style=\"font-weight: 400;\">cache:flush<\/span><\/i><span style=\"font-weight: 400;\"> deletes all files (or <\/span><i><span style=\"font-weight: 400;\">Redis flashDb<\/span><\/i><span style=\"font-weight: 400;\"> &mdash; it depends on the binding of the cache type to any storage method).<\/span><\/li>\n<li style=\"font-weight: 400;\">Q: &ndash; What is the difference between indices <i>catalog_category_product<\/i> and <i>catalog_product_category<\/i>?<br>\n<span style=\"font-weight: 400;\">A: <\/span>&ndash; There is no difference between them.<\/li>\n<\/ol>\n<p>I hope this article was useful and answered all your questions. Feel free to leave your comments down below.<\/p>\n<p>&nbsp;<\/p>\n\n","protected":false},"excerpt":{"rendered":"In this article you will find a large list of Magento 2.2 console commands; I &#8230;","protected":false},"author":82,"featured_media":17543,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[491,389],"tags":[],"class_list":["post-17522","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-magento-2","category-magento2-development","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"This article contains the list of major Magento 2 console commands, their description and how to work with them. Also, you will learn how to create your own console command and progress bar.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Andrey Litvin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/magento-2-console-commands.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#article\",\"name\":\"How to Work with Console Commands in Magento 2 | BelVG Blog\",\"headline\":\"How to Work with Console Commands in Magento 2\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/Magento-2-Console-Commands-3.png\",\"width\":1110,\"height\":590,\"caption\":\"How to work with Magento 2 console commands\"},\"datePublished\":\"2018-11-29T14:48:22+02:00\",\"dateModified\":\"2021-02-18T13:25:13+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#webpage\"},\"articleSection\":\"Magento 2, Magento 2 Development, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"position\":2,\"name\":\"Magento 2 Development\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#listItem\",\"name\":\"How to Work with Console Commands in Magento 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#listItem\",\"position\":3,\"name\":\"How to Work with Console Commands in Magento 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin\",\"name\":\"Andrey Litvin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Andrey Litvin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html\",\"name\":\"How to Work with Console Commands in Magento 2 | BelVG Blog\",\"description\":\"This article contains the list of major Magento 2 console commands, their description and how to work with them. Also, you will learn how to create your own console command and progress bar.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/Magento-2-Console-Commands-3.png\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html\\\/#mainImage\",\"width\":1110,\"height\":590,\"caption\":\"How to work with Magento 2 console commands\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/magento-2-console-commands.html#mainImage\"},\"datePublished\":\"2018-11-29T14:48:22+02:00\",\"dateModified\":\"2021-02-18T13:25:13+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Work with Console Commands in Magento 2 | BelVG Blog","description":"This article contains the list of major Magento 2 console commands, their description and how to work with them. Also, you will learn how to create your own console command and progress bar.","canonical_url":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#article","name":"How to Work with Console Commands in Magento 2 | BelVG Blog","headline":"How to Work with Console Commands in Magento 2","author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/11\/Magento-2-Console-Commands-3.png","width":1110,"height":590,"caption":"How to work with Magento 2 console commands"},"datePublished":"2018-11-29T14:48:22+02:00","dateModified":"2021-02-18T13:25:13+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#webpage"},"articleSection":"Magento 2, Magento 2 Development, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","position":2,"name":"Magento 2 Development","item":"https:\/\/belvg.com\/blog\/category\/magento2-development","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#listItem","name":"How to Work with Console Commands in Magento 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#listItem","position":3,"name":"How to Work with Console Commands in Magento 2","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author","url":"https:\/\/belvg.com\/blog\/author\/andrey-litvin","name":"Andrey Litvin","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Andrey Litvin"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#webpage","url":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html","name":"How to Work with Console Commands in Magento 2 | BelVG Blog","description":"This article contains the list of major Magento 2 console commands, their description and how to work with them. Also, you will learn how to create your own console command and progress bar.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/11\/Magento-2-Console-Commands-3.png","@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html\/#mainImage","width":1110,"height":590,"caption":"How to work with Magento 2 console commands"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html#mainImage"},"datePublished":"2018-11-29T14:48:22+02:00","dateModified":"2021-02-18T13:25:13+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"17522","title":"How to Work with Console Commands in Magento 2 | #site_title","description":"This article contains the list of major Magento 2 console commands, their description and how to work with them. Also, you will learn how to create your own console command and progress bar.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:00","updated":"2026-11-03 18:37:00"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento2-development\" title=\"Magento 2 Development\">Magento 2 Development<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Work with Console Commands in Magento 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento 2 Development","link":"https:\/\/belvg.com\/blog\/category\/magento2-development"},{"label":"How to Work with Console Commands in Magento 2","link":"https:\/\/belvg.com\/blog\/magento-2-console-commands.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/17522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=17522"}],"version-history":[{"count":9,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/17522\/revisions"}],"predecessor-version":[{"id":19868,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/17522\/revisions\/19868"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/17543"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=17522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=17522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=17522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}