Chris@0: # A Multi-Framework [Composer](http://getcomposer.org) Library Installer Chris@0: Chris@0: [![Build Status](http://img.shields.io/travis/composer/installers.svg)](http://travis-ci.org/composer/installers) Chris@0: Chris@0: This is for PHP package authors to require in their `composer.json`. It will Chris@0: install their package to the correct location based on the specified package Chris@0: type. Chris@0: Chris@0: The goal of Installers is to be a simple package type to install path map. Chris@0: Users can also customize the install path per package and package authors can Chris@0: modify the package name upon installing. Chris@0: Chris@0: Installers isn't intended on replacing all custom installers. If your Chris@0: package requires special installation handling then by all means, create a Chris@0: custom installer to handle it. Chris@0: Chris@0: **Natively Supported Frameworks**: Chris@0: Chris@0: The following frameworks natively work with Composer and will be Chris@0: installed to the default `vendor` directory. `composer/installers` Chris@0: is not needed to install packages with these frameworks: Chris@0: Chris@0: * Aura Chris@0: * Symfony2 Chris@0: * Yii Chris@0: * Yii2 Chris@0: Chris@0: ## Current Supported Package Types Chris@0: Chris@0: > Stable types are marked as **bold**, this means that installation paths Chris@0: > for those type will not be changed. Any adjustment for those types would Chris@0: > require creation of brand new type that will cover required changes. Chris@0: Chris@0: | Framework | Types Chris@0: | --------- | ----- Chris@0: | Aimeos | `aimeos-extension` Chris@0: | Asgard | `asgard-module`
`asgard-theme` Chris@0: | Attogram | `attogram-module` Chris@0: | AGL | `agl-module` Chris@0: | Bonefish | `bonefish-package` Chris@0: | AnnotateCms | `annotatecms-module`
`annotatecms-component`
`annotatecms-service` Chris@0: | Bitrix | `bitrix-module` (deprecated)
`bitrix-component` (deprecated)
`bitrix-theme` (deprecated)

`bitrix-d7-module`
`bitrix-d7-component`
`bitrix-d7-template` Chris@0: | CakePHP 2+ | **`cakephp-plugin`** Chris@0: | Chef | `chef-cookbook`
`chef-role` Chris@0: | CCFramework | `ccframework-ship`
`ccframework-theme` Chris@0: | Cockpit | `cockpit-module` Chris@0: | CodeIgniter | `codeigniter-library`
`codeigniter-third-party`
`codeigniter-module` Chris@0: | concrete5 | `concrete5-core`
`concrete5-package`
`concrete5-theme`
`concrete5-block`
`concrete5-update` Chris@0: | Craft | `craft-plugin` Chris@0: | Croogo | `croogo-plugin`
`croogo-theme` Chris@0: | Decibel | `decibel-app` Chris@0: | DokuWiki | `dokuwiki-plugin`
`dokuwiki-template` Chris@0: | Dolibarr | `dolibarr-module` Chris@0: | Drupal | `drupal-core`
`drupal-module`
`drupal-theme`

`drupal-library`
`drupal-profile`
`drupal-drush` Chris@0: | Elgg | `elgg-plugin` Chris@0: | Eliasis | `eliasis-module` Chris@0: | ExpressionEngine 3 | `ee3-addon`
`ee3-theme` Chris@0: | eZ Platform | `ezplatform-assets`
`ezplatform-meta-assets` Chris@0: | FuelPHP v1.x | `fuel-module`
`fuel-package`
`fuel-theme` Chris@0: | FuelPHP v2.x | `fuelphp-component` Chris@0: | Grav | `grav-plugin`
`grav-theme` Chris@0: | Hurad | `hurad-plugin`
`hurad-theme` Chris@0: | ImageCMS | `imagecms-template`
`imagecms-module`
`imagecms-library` Chris@0: | iTop | `itop-extension` Chris@0: | Joomla | `joomla-component`
`joomla-module`
`joomla-template`
`joomla-plugin`
`joomla-library` Chris@0: | Kanboard | `kanboard-plugin` Chris@0: | Kirby | **`kirby-plugin`**
`kirby-field`
`kirby-tag` Chris@0: | KodiCMS | `kodicms-plugin`
`kodicms-media` Chris@0: | Kohana | **`kohana-module`** Chris@0: | Lan Management System | `lms-plugin`
`lms-template`
`lms-document-template`
`lms-userpanel-module` Chris@0: | Laravel | `laravel-library` Chris@0: | Lavalite | `lavalite-theme`
`lavalite-package` Chris@0: | Lithium | **`lithium-library`
`lithium-source`** Chris@0: | Magento | `magento-library`
`magento-skin`
`magento-theme` Chris@0: | Mako | `mako-package` Chris@0: | Mautic | `mautic-plugin`
`mautic-theme` Chris@0: | Maya | `maya-module` Chris@0: | MODX Evo | `modxevo-snippet`
`modxevo-plugin`
`modxevo-module`
`modxevo-template`
`modxevo-lib` Chris@0: | MediaWiki | `mediawiki-extension` Chris@0: | October | **`october-module`
`october-plugin`
`october-theme`** Chris@0: | OntoWiki | `ontowiki-extension`
`ontowiki-theme`
`ontowiki-translation` Chris@0: | OXID | `oxid-module`
`oxid-theme`
`oxid-out` Chris@0: | Osclass | `osclass-plugin`
`osclass-theme`
`osclass-language` Chris@0: | MODULEWork | `modulework-module` Chris@0: | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types) Chris@0: | Piwik | `piwik-plugin` Chris@0: | phpBB | `phpbb-extension`
`phpbb-style`
`phpbb-language` Chris@0: | Pimcore | `pimcore-plugin` Chris@0: | Plentymarkets | `plentymarkets-plugin` Chris@0: | PPI | **`ppi-module`** Chris@0: | Puppet | `puppet-module` Chris@0: | Porto | `porto-container` Chris@0: | RadPHP | `radphp-bundle` Chris@0: | REDAXO | `redaxo-addon` Chris@0: | ReIndex | **`reindex-plugin`**
**`reindex-theme`** Chris@0: | Roundcube | `roundcube-plugin` Chris@0: | shopware | `shopware-backend-plugin`
`shopware-core-plugin`
`shopware-frontend-plugin`
`shopware-theme`
`shopware-plugin`
`shopware-frontend-theme` Chris@0: | SilverStripe | `silverstripe-module`
`silverstripe-theme` Chris@0: | SMF | `smf-module`
`smf-theme` Chris@0: | SyDES | `sydes-module`
`sydes-theme` Chris@0: | symfony1 | **`symfony1-plugin`** Chris@0: | Tusk | `tusk-task`
`tusk-command`
`tusk-asset` Chris@0: | TYPO3 Flow | `typo3-flow-package`
`typo3-flow-framework`
`typo3-flow-plugin`
`typo3-flow-site`
`typo3-flow-boilerplate`
`typo3-flow-build` Chris@0: | TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead) Chris@0: | UserFrosting | `userfrosting-sprinkle` Chris@0: | Vanilla | `vanilla-plugin`
`vanilla-theme` Chris@0: | Vgmcp | `vgmcp-bundle`
`vgmcp-theme` Chris@0: | Wolf CMS | `wolfcms-plugin` Chris@0: | WordPress | `wordpress-plugin`
`wordpress-theme`

`wordpress-muplugin` Chris@0: | YAWIK | `yawik-module` Chris@0: | Zend | `zend-library`
`zend-extra`
`zend-module` Chris@0: | Zikula | `zikula-module`
`zikula-theme` Chris@0: | Prestashop | `prestashop-module`
`prestashop-theme` Chris@0: | Phifty | `phifty-bundle`
`phifty-framework`
`phifty-library` Chris@0: Chris@0: ## Example `composer.json` File Chris@0: Chris@0: This is an example for a CakePHP plugin. The only important parts to set in your Chris@0: composer.json file are `"type": "cakephp-plugin"` which describes what your Chris@0: package is and `"require": { "composer/installers": "~1.0" }` which tells composer Chris@0: to load the custom installers. Chris@0: Chris@0: ```json Chris@0: { Chris@0: "name": "you/ftp", Chris@0: "type": "cakephp-plugin", Chris@0: "require": { Chris@0: "composer/installers": "~1.0" Chris@0: } Chris@0: } Chris@0: ``` Chris@0: Chris@0: This would install your package to the `Plugin/Ftp/` folder of a CakePHP app Chris@0: when a user runs `php composer.phar install`. Chris@0: Chris@0: So submit your packages to [packagist.org](http://packagist.org)! Chris@0: Chris@0: ## Custom Install Paths Chris@0: Chris@0: If you are consuming a package that uses the `composer/installers` you can Chris@0: override the install path with the following extra in your `composer.json`: Chris@0: Chris@0: ```json Chris@0: { Chris@0: "extra": { Chris@0: "installer-paths": { Chris@0: "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"] Chris@0: } Chris@0: } Chris@0: } Chris@0: ``` Chris@0: Chris@0: A package type can have a custom installation path with a `type:` prefix. Chris@0: Chris@0: ``` json Chris@0: { Chris@0: "extra": { Chris@0: "installer-paths": { Chris@0: "your/custom/path/{$name}/": ["type:wordpress-plugin"] Chris@0: } Chris@0: } Chris@0: } Chris@0: ``` Chris@0: Chris@0: You can also have the same vendor packages with a custom installation path by Chris@0: using the `vendor:` prefix. Chris@0: Chris@0: ``` json Chris@0: { Chris@0: "extra": { Chris@0: "installer-paths": { Chris@0: "your/custom/path/{$name}/": ["vendor:my_organization"] Chris@0: } Chris@0: } Chris@0: } Chris@0: ``` Chris@0: Chris@0: These would use your custom path for each of the listed packages. The available Chris@0: variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`. Chris@0: Chris@0: ## Custom Install Names Chris@0: Chris@0: If you're a package author and need your package to be named differently when Chris@0: installed consider using the `installer-name` extra. Chris@0: Chris@0: For example you have a package named `shama/cakephp-ftp` with the type Chris@0: `cakephp-plugin`. Installing with `composer/installers` would install to the Chris@0: path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a Chris@0: package author actually need the package to be named and installed to Chris@0: `Plugin/Ftp`. Using the following config within your **package** `composer.json` Chris@0: will allow this: Chris@0: Chris@0: ```json Chris@0: { Chris@0: "name": "shama/cakephp-ftp", Chris@0: "type": "cakephp-plugin", Chris@0: "extra": { Chris@0: "installer-name": "Ftp" Chris@0: } Chris@0: } Chris@0: ``` Chris@0: Chris@0: Please note the name entered into `installer-name` will be the final and will Chris@0: not be inflected. Chris@0: Chris@0: ## Should we allow dynamic package types or paths? No. Chris@0: Chris@0: What are they? The ability for a package author to determine where a package Chris@0: will be installed either through setting the path directly in their Chris@0: `composer.json` or through a dynamic package type: `"type": Chris@0: "framework-install-here"`. Chris@0: Chris@0: It has been proposed many times. Even implemented once early on and then Chris@0: removed. Installers won't do this because it would allow a single package Chris@0: author to wipe out entire folders without the user's consent. That user would Chris@0: then come here to yell at us. Chris@0: Chris@0: Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.