"Use composer packages to distribute (especially commercial) extensions. For a local environment, it is fine to develop your own code under app/code. However, once you distribute your module to other environments, it should be through composer as otherwise dependencies are left unmanaged. In a production environment, the app/code folder should therefore ideally be empty."
app/code
app/code
app/code
app/code
should be empty"If your module depends on other modules, make sure that both your composer file and your module.xml file reflect this. If your module only depends on the Magento framework, your module should likely be treated as a library, not a module. Your composer version constraints should respect the semantic versioning standards of Magento."
File etc/module.xml
:
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Yireo_Foobar" setup_version="0.0.1" /></config>
File etc/module.xml
:
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Yireo_Foobar" setup_version="0.0.1"> <sequence> <module name="Magento_Catalog" /> </sequence> </module></config>
File etc/module.xml
:
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Yireo_Foobar" setup_version="0.0.1"> <sequence> <module name="Magento_Catalog" /> <module name="Magento_Backend" /> </sequence> </module></config>
File etc/module.xml
:
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Yireo_Foobar" setup_version="0.0.1"> <sequence> <module name="Magento_Catalog" /> <module name="Magento_Backend" /> <module name="Magento_Ui" /> </sequence> </module></config>
File etc/module.xml
:
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Yireo_Foobar" setup_version="0.0.1"> <sequence> <module name="Magento_Catalog" /> <module name="Magento_Backend" /> <module name="Magento_Ui" /> <module name="Magento_Store" /> </sequence> </module></config>
File composer.json
:
"require": { "magento/framework": "^100.1|^101.0|^102.0", "magento/module-backend": "^101.0|^102.0", "magento/module-catalog": "^100.0|^101.0", "magento/module-store": "^100.1|^101.0", "magento/module-ui": "^101.0", "php": ">=7.0.0" },
"Use a static analysis tool like PHP CodeSniffer (with the ExtDN and MEQP rulesets). Check whether your extension works in Production Mode. Confirm your extension works under the Magento versions that you claim compatibility with. Have a colleague or friend review your code before releasing it."
Not just tools:
https://github.com/extdn/extdn-phpcs
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |