Chris@0
|
1 # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
|
Chris@0
|
2
|
Chris@0
|
3 [](http://travis-ci.org/composer/installers)
|
Chris@0
|
4
|
Chris@0
|
5 This is for PHP package authors to require in their `composer.json`. It will
|
Chris@0
|
6 install their package to the correct location based on the specified package
|
Chris@0
|
7 type.
|
Chris@0
|
8
|
Chris@0
|
9 The goal of Installers is to be a simple package type to install path map.
|
Chris@0
|
10 Users can also customize the install path per package and package authors can
|
Chris@0
|
11 modify the package name upon installing.
|
Chris@0
|
12
|
Chris@0
|
13 Installers isn't intended on replacing all custom installers. If your
|
Chris@0
|
14 package requires special installation handling then by all means, create a
|
Chris@0
|
15 custom installer to handle it.
|
Chris@0
|
16
|
Chris@0
|
17 **Natively Supported Frameworks**:
|
Chris@0
|
18
|
Chris@0
|
19 The following frameworks natively work with Composer and will be
|
Chris@0
|
20 installed to the default `vendor` directory. `composer/installers`
|
Chris@0
|
21 is not needed to install packages with these frameworks:
|
Chris@0
|
22
|
Chris@0
|
23 * Aura
|
Chris@0
|
24 * Symfony2
|
Chris@0
|
25 * Yii
|
Chris@0
|
26 * Yii2
|
Chris@0
|
27
|
Chris@0
|
28 ## Current Supported Package Types
|
Chris@0
|
29
|
Chris@0
|
30 > Stable types are marked as **bold**, this means that installation paths
|
Chris@0
|
31 > for those type will not be changed. Any adjustment for those types would
|
Chris@0
|
32 > require creation of brand new type that will cover required changes.
|
Chris@0
|
33
|
Chris@0
|
34 | Framework | Types
|
Chris@0
|
35 | --------- | -----
|
Chris@0
|
36 | Aimeos | `aimeos-extension`
|
Chris@0
|
37 | Asgard | `asgard-module`<br>`asgard-theme`
|
Chris@0
|
38 | Attogram | `attogram-module`
|
Chris@0
|
39 | AGL | `agl-module`
|
Chris@0
|
40 | Bonefish | `bonefish-package`
|
Chris@0
|
41 | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
|
Chris@0
|
42 | Bitrix | `bitrix-module` (deprecated) <br>`bitrix-component` (deprecated) <br>`bitrix-theme` (deprecated) <br><br> `bitrix-d7-module` <br> `bitrix-d7-component` <br> `bitrix-d7-template`
|
Chris@0
|
43 | CakePHP 2+ | **`cakephp-plugin`**
|
Chris@0
|
44 | Chef | `chef-cookbook`<br>`chef-role`
|
Chris@0
|
45 | CCFramework | `ccframework-ship`<br>`ccframework-theme`
|
Chris@0
|
46 | Cockpit | `cockpit-module`
|
Chris@0
|
47 | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
|
Chris@0
|
48 | concrete5 | `concrete5-core`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-block`<br>`concrete5-update`
|
Chris@0
|
49 | Craft | `craft-plugin`
|
Chris@0
|
50 | Croogo | `croogo-plugin`<br>`croogo-theme`
|
Chris@0
|
51 | Decibel | `decibel-app`
|
Chris@0
|
52 | DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
|
Chris@0
|
53 | Dolibarr | `dolibarr-module`
|
Chris@0
|
54 | Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
|
Chris@0
|
55 | Elgg | `elgg-plugin`
|
Chris@0
|
56 | Eliasis | `eliasis-module`
|
Chris@0
|
57 | ExpressionEngine 3 | `ee3-addon`<br>`ee3-theme`
|
Chris@0
|
58 | eZ Platform | `ezplatform-assets`<br>`ezplatform-meta-assets`
|
Chris@0
|
59 | FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
|
Chris@0
|
60 | FuelPHP v2.x | `fuelphp-component`
|
Chris@0
|
61 | Grav | `grav-plugin`<br>`grav-theme`
|
Chris@0
|
62 | Hurad | `hurad-plugin`<br>`hurad-theme`
|
Chris@0
|
63 | ImageCMS | `imagecms-template`<br>`imagecms-module`<br>`imagecms-library`
|
Chris@0
|
64 | iTop | `itop-extension`
|
Chris@0
|
65 | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
|
Chris@0
|
66 | Kanboard | `kanboard-plugin`
|
Chris@0
|
67 | Kirby | **`kirby-plugin`**<br>`kirby-field`<br>`kirby-tag`
|
Chris@0
|
68 | KodiCMS | `kodicms-plugin`<br>`kodicms-media`
|
Chris@0
|
69 | Kohana | **`kohana-module`**
|
Chris@0
|
70 | Lan Management System | `lms-plugin`<br>`lms-template`<br>`lms-document-template`<br>`lms-userpanel-module`
|
Chris@0
|
71 | Laravel | `laravel-library`
|
Chris@0
|
72 | Lavalite | `lavalite-theme`<br>`lavalite-package`
|
Chris@0
|
73 | Lithium | **`lithium-library`<br>`lithium-source`**
|
Chris@0
|
74 | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
|
Chris@0
|
75 | Mako | `mako-package`
|
Chris@0
|
76 | Mautic | `mautic-plugin`<br>`mautic-theme`
|
Chris@0
|
77 | Maya | `maya-module`
|
Chris@0
|
78 | MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
|
Chris@0
|
79 | MediaWiki | `mediawiki-extension`
|
Chris@0
|
80 | October | **`october-module`<br>`october-plugin`<br>`october-theme`**
|
Chris@0
|
81 | OntoWiki | `ontowiki-extension`<br>`ontowiki-theme`<br>`ontowiki-translation`
|
Chris@0
|
82 | OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
|
Chris@0
|
83 | Osclass | `osclass-plugin`<br>`osclass-theme`<br>`osclass-language`
|
Chris@0
|
84 | MODULEWork | `modulework-module`
|
Chris@0
|
85 | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
|
Chris@0
|
86 | Piwik | `piwik-plugin`
|
Chris@0
|
87 | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
|
Chris@0
|
88 | Pimcore | `pimcore-plugin`
|
Chris@0
|
89 | Plentymarkets | `plentymarkets-plugin`
|
Chris@0
|
90 | PPI | **`ppi-module`**
|
Chris@0
|
91 | Puppet | `puppet-module`
|
Chris@0
|
92 | Porto | `porto-container`
|
Chris@0
|
93 | RadPHP | `radphp-bundle`
|
Chris@0
|
94 | REDAXO | `redaxo-addon`
|
Chris@0
|
95 | ReIndex | **`reindex-plugin`** <br> **`reindex-theme`**
|
Chris@0
|
96 | Roundcube | `roundcube-plugin`
|
Chris@0
|
97 | shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`<br/>`shopware-plugin`<br/>`shopware-frontend-theme`
|
Chris@0
|
98 | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
|
Chris@0
|
99 | SMF | `smf-module`<br>`smf-theme`
|
Chris@0
|
100 | SyDES | `sydes-module`<br>`sydes-theme`
|
Chris@0
|
101 | symfony1 | **`symfony1-plugin`**
|
Chris@0
|
102 | Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
|
Chris@0
|
103 | TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
|
Chris@0
|
104 | 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
|
105 | UserFrosting | `userfrosting-sprinkle`
|
Chris@0
|
106 | Vanilla | `vanilla-plugin`<br>`vanilla-theme`
|
Chris@0
|
107 | Vgmcp | `vgmcp-bundle`<br>`vgmcp-theme`
|
Chris@0
|
108 | Wolf CMS | `wolfcms-plugin`
|
Chris@0
|
109 | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
|
Chris@0
|
110 | YAWIK | `yawik-module`
|
Chris@0
|
111 | Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
|
Chris@0
|
112 | Zikula | `zikula-module`<br>`zikula-theme`
|
Chris@0
|
113 | Prestashop | `prestashop-module`<br>`prestashop-theme`
|
Chris@0
|
114 | Phifty | `phifty-bundle`<br>`phifty-framework`<br>`phifty-library`
|
Chris@0
|
115
|
Chris@0
|
116 ## Example `composer.json` File
|
Chris@0
|
117
|
Chris@0
|
118 This is an example for a CakePHP plugin. The only important parts to set in your
|
Chris@0
|
119 composer.json file are `"type": "cakephp-plugin"` which describes what your
|
Chris@0
|
120 package is and `"require": { "composer/installers": "~1.0" }` which tells composer
|
Chris@0
|
121 to load the custom installers.
|
Chris@0
|
122
|
Chris@0
|
123 ```json
|
Chris@0
|
124 {
|
Chris@0
|
125 "name": "you/ftp",
|
Chris@0
|
126 "type": "cakephp-plugin",
|
Chris@0
|
127 "require": {
|
Chris@0
|
128 "composer/installers": "~1.0"
|
Chris@0
|
129 }
|
Chris@0
|
130 }
|
Chris@0
|
131 ```
|
Chris@0
|
132
|
Chris@0
|
133 This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
|
Chris@0
|
134 when a user runs `php composer.phar install`.
|
Chris@0
|
135
|
Chris@0
|
136 So submit your packages to [packagist.org](http://packagist.org)!
|
Chris@0
|
137
|
Chris@0
|
138 ## Custom Install Paths
|
Chris@0
|
139
|
Chris@0
|
140 If you are consuming a package that uses the `composer/installers` you can
|
Chris@0
|
141 override the install path with the following extra in your `composer.json`:
|
Chris@0
|
142
|
Chris@0
|
143 ```json
|
Chris@0
|
144 {
|
Chris@0
|
145 "extra": {
|
Chris@0
|
146 "installer-paths": {
|
Chris@0
|
147 "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
|
Chris@0
|
148 }
|
Chris@0
|
149 }
|
Chris@0
|
150 }
|
Chris@0
|
151 ```
|
Chris@0
|
152
|
Chris@0
|
153 A package type can have a custom installation path with a `type:` prefix.
|
Chris@0
|
154
|
Chris@0
|
155 ``` json
|
Chris@0
|
156 {
|
Chris@0
|
157 "extra": {
|
Chris@0
|
158 "installer-paths": {
|
Chris@0
|
159 "your/custom/path/{$name}/": ["type:wordpress-plugin"]
|
Chris@0
|
160 }
|
Chris@0
|
161 }
|
Chris@0
|
162 }
|
Chris@0
|
163 ```
|
Chris@0
|
164
|
Chris@0
|
165 You can also have the same vendor packages with a custom installation path by
|
Chris@0
|
166 using the `vendor:` prefix.
|
Chris@0
|
167
|
Chris@0
|
168 ``` json
|
Chris@0
|
169 {
|
Chris@0
|
170 "extra": {
|
Chris@0
|
171 "installer-paths": {
|
Chris@0
|
172 "your/custom/path/{$name}/": ["vendor:my_organization"]
|
Chris@0
|
173 }
|
Chris@0
|
174 }
|
Chris@0
|
175 }
|
Chris@0
|
176 ```
|
Chris@0
|
177
|
Chris@0
|
178 These would use your custom path for each of the listed packages. The available
|
Chris@0
|
179 variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
|
Chris@0
|
180
|
Chris@0
|
181 ## Custom Install Names
|
Chris@0
|
182
|
Chris@0
|
183 If you're a package author and need your package to be named differently when
|
Chris@0
|
184 installed consider using the `installer-name` extra.
|
Chris@0
|
185
|
Chris@0
|
186 For example you have a package named `shama/cakephp-ftp` with the type
|
Chris@0
|
187 `cakephp-plugin`. Installing with `composer/installers` would install to the
|
Chris@0
|
188 path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
|
Chris@0
|
189 package author actually need the package to be named and installed to
|
Chris@0
|
190 `Plugin/Ftp`. Using the following config within your **package** `composer.json`
|
Chris@0
|
191 will allow this:
|
Chris@0
|
192
|
Chris@0
|
193 ```json
|
Chris@0
|
194 {
|
Chris@0
|
195 "name": "shama/cakephp-ftp",
|
Chris@0
|
196 "type": "cakephp-plugin",
|
Chris@0
|
197 "extra": {
|
Chris@0
|
198 "installer-name": "Ftp"
|
Chris@0
|
199 }
|
Chris@0
|
200 }
|
Chris@0
|
201 ```
|
Chris@0
|
202
|
Chris@0
|
203 Please note the name entered into `installer-name` will be the final and will
|
Chris@0
|
204 not be inflected.
|
Chris@0
|
205
|
Chris@0
|
206 ## Should we allow dynamic package types or paths? No.
|
Chris@0
|
207
|
Chris@0
|
208 What are they? The ability for a package author to determine where a package
|
Chris@0
|
209 will be installed either through setting the path directly in their
|
Chris@0
|
210 `composer.json` or through a dynamic package type: `"type":
|
Chris@0
|
211 "framework-install-here"`.
|
Chris@0
|
212
|
Chris@0
|
213 It has been proposed many times. Even implemented once early on and then
|
Chris@0
|
214 removed. Installers won't do this because it would allow a single package
|
Chris@0
|
215 author to wipe out entire folders without the user's consent. That user would
|
Chris@0
|
216 then come here to yell at us.
|
Chris@0
|
217
|
Chris@0
|
218 Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.
|