Magento2 开发之删除、禁用、开启模块
在Magento2的开发过程中,通常会遇到模块的删禁启等操作,那么,如何进行这些操作呢?如下:
查看模块状态:
php bin/magento module:status
删除模块<慎用>
#composer安装的模块
php bin/magento module:uninstall -r <Vendor>_<Module>
- 删除文件夹:app/code/<Vendor>/<Module>
- 从数据库中删除模块表
- 删除配置设置。
DELETE FROM core_config_data WHERE path LIKE 'vendor_module/%'
删除app/etc/config.php文件中模块信息
删除setup_module表中_信息
DELETE FROM setup_module WHERE module='<Vendor>_<Module>'
禁用模块
php bin/magento module:disable <Vendor>_<Module>
启用模块
php bin/magento module:enable <Vendor>_<Module>
注:禁用和启用模块 ,可以同时禁用启用多个模块 ,用空格分隔。如:
php bin/magento module:disable<enable> Magento_AdobeIms Magento_AdobeImsApi
启用禁用模块需考虑模块之间的依赖关系。