Magento 2使用Composer打包、分发、安装、升级。
要打包组件, 必须:
composer.json
registration.PHP
Magento 2 composer.json 文件定义的名字,要求,版本,和组件的其他基本信息。此文件必须放在模块的根目录中。
{ "name": "magento/sample-module-newpage", "description": "A Magento 2 module that creates a new page", "type": "magento2-module", "version": "1.0.0", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/framework": "~100.0.4" }, "autoload": { "files": [ "registration.php" ], "psr-4": { "Magento\\SampleNewPage\\": "" } } }