drupal模块开发

添加一个 composer.json 文件

日期:2016-06-20 阅读:1808

dmandwp系统 - wordpress系统和DM系统区块建站>>

https://www.drupal.org/node/2514612

Composer package naming conventions https://www.drupal.org/node/2471927

 

Define your module as a PHP package
The wider PHP community uses Composer to manage packages; this is also done in Drupal. For example, the Drupal project has a dependency on the "drupal/core" package. The "drupal/core" package has a type defined as "drupal-core" so Composer knows what to do with it. The composer/installers library defines a number of Drupal types. These are

drupal-module
drupal-theme
drupal-library
drupal-profile
drupal-drush
As part of your module you should include a composer.json, which at a minimum defines the name, description and type of your module.

{
    "name": "drupal/example",
    "description": "This is an example composer.json for example module.",
    "type": "drupal-module",
    "license": "GPL-2.0+"
}

可以百度下什么是php composer

对于前端来说,了解node.js有个npm工具。 composer就是类似的工具。用来管理网上的php模块。

一般用个composer.json来声明下。

----------

注意,composer.json并不是必须的,如果你不想让别人通过composer工具来得到你的模块,就可以不用写composer.json

 

<<点击返回