Magento 2 Get all the module list programmatically.

You can get the list of available modules in Magento 2. You can manually check your all the module list from app/etc/config.php

You can get all the Active module list using Magento\Framework\Module\FullModuleList class.

FullModuleList.php class used for getting all the module in Magento 2 whether its enable or disabled. Continue reading “Magento 2 Get all the module list programmatically.”

How to get Dependent(Sequence) module list of a specific module programmatically in Magento 2?

You can get the list of dependent module and schema version for a specific module using programmatically by Magento\Framework\Module\ModuleList class.

You can manually check the list of the dependent module for a module using an etc/module.xml file.

Let’s we Check the dependency list for a Catalog Module. you can check the module.xml file for catalog module is,

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Magento_Catalog" >
        <sequence>
            <module name="Magento_Eav"/>
            <module name="Magento_Cms"/>
            <module name="Magento_Indexer"/>
            <module name="Magento_Customer"/>
        </sequence>
    </module>
</config>

you can check above XML, There are four modules on which catalog is dependent.  Continue reading “How to get Dependent(Sequence) module list of a specific module programmatically in Magento 2?”

Magento 2 Get all the Enable (Active) module list programmatically.

You can get the list of all Enable module in Magento 2.  You can manually check your all the enable module list from app/etc/config.php file module name with status set to 1.

‘Magento_Store’ => 1 Store Module is Enable.

‘MSP_ReCaptcha’ => 0 Recaptcha Module is disable. Continue reading “Magento 2 Get all the Enable (Active) module list programmatically.”