skynet / installers
多框架 Composer 库安装器
Requires
- php: >=8.1
- composer-plugin-api: ^1.0 || ^2.0
- hflabs/dadata: *
- html2text/html2text: ^4.3
- irazasyed/telegram-bot-sdk: 3.x-dev
- kub-at/php-simple-html-dom-parser: dev-master
- mobiledetect/mobiledetectlib: ^3.74.0
- neos/diff: ^8.3
- nette/utils: ^4.0
- respect/rest: 0.6.1
- spatie/array-to-xml: dev-main
Requires (Dev)
- composer/composer: *@dev
- phpunit/phpunit: 4.1.*
Replaces
- roundcube/plugin-installer: *
- shama/baton: *
This package is auto-updated.
Last update: 2024-09-23 18:47:07 UTC
README
此工具供 PHP 包作者在他们的 composer.json
中使用。它将根据指定的包类型将包安装到正确的位置。
Installers 的目标是成为一个简单的包类型到安装路径映射。用户也可以根据每个包自定义安装路径,包作者可以在安装时修改包名。
Installers 并不打算取代所有自定义安装器。如果您的包需要特殊安装处理,则请创建一个自定义安装器来处理。
原生支持框架:
以下框架与 Composer 原生兼容,并将安装到默认的 vendor
目录。安装这些框架的包不需要 composer/installers
- Aura
- Symfony2
- Yii
- Yii2
当前支持的包类型
稳定的类型用粗体表示,这意味着这些类型的安装路径将不会更改。对这些类型的任何调整都需要创建全新的类型以涵盖所需的变化。
框架 | 类型 |
---|---|
Aimeos | aimeos-extension |
Asgard | asgard-module asgard-theme |
Attogram | attogram-module |
AGL | agl-module |
Bonefish | bonefish-package |
AnnotateCms | annotatecms-module annotatecms-component annotatecms-service |
Bitrix | bitrix-module (已弃用)bitrix-component (已弃用)bitrix-theme (已弃用)bitrix-d7-module bitrix-d7-component bitrix-d7-template |
CakePHP 2+ | cakephp-plugin |
Chef | chef-cookbook chef-role |
CCFramework | ccframework-ship ccframework-theme |
Cockpit | cockpit-module |
CodeIgniter | codeigniter-library codeigniter-third-party codeigniter-module |
concrete5 | concrete5-core concrete5-package concrete5-theme concrete5-block concrete5-update |
Craft | craft-plugin |
Croogo | croogo-plugin croogo-theme |
Decibel | decibel-app |
DokuWiki | dokuwiki-plugin dokuwiki-template |
Dolibarr | dolibarr-module |
Drupal | drupal-core drupal-module drupal-theme drupal-library drupal-profile drupal-drush |
Elgg | elgg-plugin |
Eliasis | eliasis-module |
ExpressionEngine 3 | ee3-addon ee3-theme |
eZ Platform | ezplatform-assets ezplatform-meta-assets |
FuelPHP v1.x | fuel-module fuel-package <br/>fuel-theme |
FuelPHP v2.x | fuelphp-component |
Grav | grav-plugin grav-theme |
Hurad | hurad-plugin hurad-theme |
ImageCMS | imagecms-template imagecms-module imagecms-library |
iTop | itop-extension |
Joomla | joomla-component joomla-module joomla-template joomla-plugin joomla-library |
Kanboard | kanboard-plugin |
Kirby | kirby-plugin kirby-field kirby-tag |
KodiCMS | kodicms-plugin kodicms-media |
Kohana | kohana-module |
Lan Management System | lms-plugin lms-template lms-document-template lms-userpanel-module |
Laravel | laravel-library |
Lavalite | lavalite-theme lavalite-package |
Lithium | lithium-library lithium-source |
Magento | magento-library magento-skin magento-theme |
Mako | mako-package |
Mautic | mautic-plugin mautic-theme |
Maya | maya-module |
MODX Evo | modxevo-snippet modxevo-plugin modxevo-module modxevo-template modxevo-lib |
MediaWiki | mediawiki-extension |
October | october-module october-plugin october-theme |
OntoWiki | ontowiki-extension ontowiki-theme ontowiki-translation |
OXID | oxid-module oxid-theme oxid-out |
Osclass | osclass-plugin osclass-theme osclass-language |
MODULEWork | modulework-module |
Moodle | moodle-* (请检查源代码以获取所有受支持类型) |
Piwik | piwik-plugin |
phpBB | phpbb-extension phpbb-style phpbb-language |
Pimcore | pimcore-plugin |
Plentymarkets | plentymarkets-plugin |
PPI | ppi-module |
Puppet | puppet-module |
Porto | porto-container |
RadPHP | radphp-bundle |
REDAXO | redaxo-addon |
ReIndex | reindex-plugin reindex-theme |
Roundcube | roundcube-plugin |
shopware | shopware-backend-plugin <br/>shopware-core-plugin <br/>shopware-frontend-plugin <br/>shopware-theme <br/>shopware-plugin <br/>shopware-frontend-theme |
SilverStripe | silverstripe-module silverstripe-theme |
SMF | smf-module smf-theme |
SyDES | sydes-module sydes-theme |
symfony1 | symfony1-plugin |
Tusk | tusk-task tusk-command tusk-asset |
TYPO3 Flow | typo3-flow-package typo3-flow-framework typo3-flow-plugin typo3-flow-site typo3-flow-boilerplate typo3-flow-build |
TYPO3 CMS | typo3-cms-extension (在此包中已弃用,请使用TYPO3 CMS Installers替代) |
UserFrosting | userfrosting-sprinkle |
Vanilla | vanilla-plugin vanilla-theme |
Vgmcp | vgmcp-bundle vgmcp-theme |
Wolf CMS | wolfcms-plugin |
WordPress | wordpress-plugin wordpress-theme wordpress-muplugin |
YAWIK | yawik-module |
Zend | zend-library zend-extra zend-module |
Zikula | zikula-module zikula-theme |
Prestashop | prestashop-module prestashop-theme |
Phifty | phifty-bundle phifty-framework phifty-library |
示例 composer.json
文件
这是一个 CakePHP 插件的示例。在您的 composer.json 文件中需要设置的仅有的重要部分是 "type": "cakephp-plugin"
,它描述了您的包是什么,以及 "require": { "composer/installers": "~1.0" }
,它告诉 composer 加载自定义安装程序。
{
"name": "you/ftp",
"type": "cakephp-plugin",
"require": {
"composer/installers": "~1.0"
}
}
当用户运行 php composer.phar install
时,这将在 CakePHP 应用的 Plugin/Ftp/
文件夹中安装您的包。
因此,将您的包提交到 packagist.org!
自定义安装路径
如果您正在使用 composer/installers
消费包,您可以使用以下 composer.json
中的额外选项覆盖安装路径
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
}
}
}
包类型可以具有自定义安装路径,以 type:
前缀开头。
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["type:wordpress-plugin"]
}
}
}
您还可以使用 vendor:
前缀具有相同供应商包的自定义安装路径。
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["vendor:my_organization"]
}
}
}
这些将使用您的自定义路径为列出的每个包。您可以在路径中使用以下变量:{$name}
、{$vendor}
、{$type}
。
自定义安装名称
如果您是包作者,并且需要您的包在安装时使用不同的名称,请考虑使用 installer-name
额外选项。
例如,您有一个名为 shama/cakephp-ftp
的软件包,其类型为 cakephp-plugin
。使用 composer/installers
安装将会安装到路径 Plugin/CakephpFtp
。由于严格的命名约定,您作为软件包作者实际上需要软件包命名为并安装到 Plugin/Ftp
。在您的 软件包 的 composer.json
中使用以下配置将允许这样做
{
"name": "shama/cakephp-ftp",
"type": "cakephp-plugin",
"extra": {
"installer-name": "Ftp"
}
}
请注意,输入到 installer-name
的名称将是最终的,并且不会被变形。
我们是否应该允许动态软件包类型或路径?不。
它们是什么?允许软件包作者通过在他们的 composer.json
中直接设置路径或通过动态软件包类型:"type": "framework-install-here"
来确定软件包将被安装的位置。
这已经被多次提议。甚至在早期实施过一次,然后被移除。安装器不会这样做,因为这将允许单个软件包作者在未经用户同意的情况下清除整个文件夹。然后那个用户会来这里向我们大喊。
任何仍然想要这个功能的人应该考虑要求 https://github.com/oomphinc/composer-installers-extender。