在Magento 2中修改已经编辑好的的页面,由于需要更改所有的页面,所以要使用到批量修改命令。
mangento 2给我们提供了很好的命令。我们首先需要在安装的根目录执行下面的命令。
1.下面是更新的是产品的属性批量修改。
1 | sudo -u apache php bin/magento queue:consumers:start product_action_attribute.update --max-messages=20 |
2.我们如果开启了后台的customer异步,有时候客户注册了用户没有及时更新,就需要批量更新后台customer grid表
1 | sudo -u apache php bin/magento indexer:reindex customer_grid |
3.禁用某个模块或者插件命令
1 | sudo -u apache php bin/magento module:disable Magento_Csp |
4.查看模块状态是否开启或关闭命令
1 | sudo -u apache php bin/magento module:status |
5.查看当前的magento 2系统开启的模式
1 2 3 4 5 6 | sudo -u apache php bin/magento deploy:mode:show [root@ip-10-2-110-17 sky8g.com]# sudo -u apache php bin/magento deploy:mode:show Current application mode: production. (Note: Environment variables may override this value.) You have mail in /var/spool/mail/root [root@ip-10-2-110-17 sky8g.com]# |
6.设置的模式:{mode} 可以使用的 default ,developer 或者 production
1 | sudo -u apache php bin/magento deploy:mode:set production -s |
注意: -s是指跳过编译,如果不加-s参数就会启动维护模式。最好使用维护模式进行模式切换和编译(推荐)
7.查看缓存的状态
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | [root@ip-10-2-110-17 sky8g.com]# sudo -u apache php bin/magento cache:status Current status: config: 1 layout: 1 block_html: 1 collections: 1 reflection: 1 db_ddl: 1 compiled_config: 1 eav: 1 customer_notification: 1 config_integration: 1 config_integration_api: 1 google_product: 1 full_page: 1 config_webservice: 1 translate: 1 vertex: 1 |
8.查看magento 2最近一段时间里修改过的文件
1 2 3 4 5 6 7 | [root@ip-10-2-110-17 design]# find ./ -name "*.xml" -newermt 2020-06-10 ! -newermt 2020-07-03 ./frontend/Alothemes/bioli/Magento_Catalog/layout/catalog_category_view.xml ./frontend/Alothemes/bioli/Magento_Customer/layout/default.xml ./frontend/Alothemes/bioli/Magento_Theme/layout/default.xml ./frontend/Alothemes/bioli/Magiccart_Magicmenu/layout/default.xml ./frontend/Alothemes/framework/Magento_Customer/layout/default.xml [root@ip-10-2-110-17 design]# |
查看当前目录下在2020年6月10号到 7月3号修改的文件。