Home

Awesome

A Multi-Framework Composer Library Installer

Continuous Integration

This is for PHP package authors to require in their composer.json. It will install their package to the correct location based on the specified package type.

The goal of Installers is to be a simple package type to install path map. Users can also customize the install path per package and package authors can modify the package name upon installing.

Installers isn't intended on replacing all custom installers. If your package requires special installation handling then by all means, create a custom installer to handle it.

Natively Supported Frameworks:

Most frameworks these days natively work with Composer and will be installed to the default vendor directory. composer/installers is not needed to install packages with these frameworks.

Alternative to custom installers with Composer 2.1+

As of Composer 2.1, the Composer\InstalledVersions class has a getInstalledPackagesByType method which can let you figure out at runtime which plugins/modules/extensions are installed.

It is highly recommended to use that instead of building new custom installers if you are building a new application. This has the advantage of leaving all vendor code in the vendor directory, and not requiring custom installer code.

Current Supported Package Types

Stable types are marked as bold, this means that installation paths for those type will not be changed. Any adjustment for those types would require creation of brand new type that will cover required changes.

FrameworkTypes
Akauntingakaunting-module
Asgardasgard-module<br>asgard-theme
Attogramattogram-module
AGLagl-module
Bonefishbonefish-package
Botblebotble-plugin<br>botble-theme
AnnotateCmsannotatecms-module<br>annotatecms-component<br>annotatecms-service
Bitrixbitrix-module (deprecated) <br>bitrix-component (deprecated) <br>bitrix-theme (deprecated) <br><br> bitrix-d7-module <br> bitrix-d7-component <br> bitrix-d7-template
CakePHP 2+cakephp-plugin
Chefchef-cookbook<br>chef-role
CiviCrmcivicrm-ext
CCFrameworkccframework-ship<br>ccframework-theme
Cockpitcockpit-module
CodeIgnitercodeigniter-library<br>codeigniter-third-party<br>codeigniter-module
concrete5concrete5-core<br>concrete5-package<br>concrete5-theme<br>concrete5-block<br>concrete5-update
ConcreteCMSconcretecms-core<br>concretecms-package<br>concretecms-theme<br>concretecms-block<br>concretecms-update
Croogocroogo-plugin<br>croogo-theme
Decibeldecibel-app
Dframedframe-module
DokuWikidokuwiki-plugin<br>dokuwiki-template
Dolibarrdolibarr-module
Drupal<b>drupal-core<br>drupal-module<br>drupal-theme</b><br>drupal-library<br>drupal-profile<br>drupal-database-driver<br>drupal-drush<br>drupal-custom-theme<br>drupal-custom-module<br>drupal-custom-profile<br>drupal-drupal-multisite<br>drupal-console<br>drupal-console-language<br>drupal-config<br>drupal-recipe
Elggelgg-plugin
Eliasiseliasis-component<br>eliasis-module<br>eliasis-plugin<br>eliasis-template
ExpressionEngine 3ee3-addon<br>ee3-theme
eZ Platformezplatform-assets<br>ezplatform-meta-assets
ForkCMS ^v6.xfork-cms-module<br>fork-cms-theme
FuelPHP v1.xfuel-module<br>fuel-package<br/>fuel-theme
FuelPHP v2.xfuelphp-component
Gravgrav-plugin<br>grav-theme
Huradhurad-plugin<br>hurad-theme
ImageCMSimagecms-template<br>imagecms-module<br>imagecms-library
iTopitop-extension
Kanboardkanboard-plugin
Knownknown-plugin<br>known-theme<br>known-console
KodiCMSkodicms-plugin<br>kodicms-media
Kohanakohana-module
Lan Management Systemlms-plugin<br>lms-template<br>lms-document-template<br>lms-userpanel-module
Laravellaravel-library
Lavalitelavalite-theme<br>lavalite-package
Lithiumlithium-library<br>lithium-source
Magentomagento-library<br>magento-skin<br>magento-theme
majimamajima-plugin
Makomako-package
MantisBTmantisbt-plugin
Matomomatomo-plugin
Mauticmautic-core<br>mautic-plugin<br>mautic-theme
Mayamaya-module
MODXmodx-extra
MODX Evomodxevo-snippet<br>modxevo-plugin<br>modxevo-module<br>modxevo-template<br>modxevo-lib
MediaWikimediawiki-extension
Miaoxingmiaoxing-plugin
Octoberoctober-module<br>october-plugin<br>october-theme
OntoWikiontowiki-extension<br>ontowiki-theme<br>ontowiki-translation
OXIDoxid-module<br>oxid-theme<br>oxid-out
Osclassosclass-plugin<br>osclass-theme<br>osclass-language
MODULEWorkmodulework-module
Moodlemoodle-* (Please check source for all supported types)
Pantheonquicksilver-script<br>quicksilver-module
Piwikpiwik-plugin
Phiftyphifty-bundle<br>phifty-framework<br>phifty-library
phpBBphpbb-extension<br>phpbb-style<br>phpbb-language
Plentymarketsplentymarkets-plugin
PPIppi-module
Prestashopprestashop-module<br>prestashop-theme
Puppetpuppet-module
Portoporto-container
ProcessWireprocesswire-module
RadPHPradphp-bundle
REDAXOredaxo-addon
REDAXO bestyle-pluginredaxo-bestyle-plugin
REDAXO V5.*redaxo5-addon
REDAXO V5.* bestyle-pluginredaxo5-bestyle-plugin
ReIndexreindex-plugin <br> reindex-theme
Roundcuberoundcube-plugin
shopwareshopware-backend-plugin<br/>shopware-core-plugin<br/>shopware-frontend-plugin<br/>shopware-theme<br/>shopware-plugin<br/>shopware-frontend-theme
SilverStripesilverstripe-module<br>silverstripe-theme
SiteDirectsitedirect-module<br>sitedirect-plugin
SMFsmf-module<br>smf-theme
Starbugstarbug-module<br>starbug-theme<br>starbug-custom-module<br>starbug-custom-theme
SyDESsydes-module<br>sydes-theme
Syliussylius-theme
TAOtao-extension
TastyIgnitertastyigniter-module<br>tastyigniter-extension<br>tastyigniter-theme
Tusktusk-task<br>tusk-command<br>tusk-asset
UserFrostinguserfrosting-sprinkle
Vanillavanilla-plugin<br>vanilla-theme
Vgmcpvgmcp-bundle<br>vgmcp-theme
WHMCSwhmcs-addons<br>whmcs-fraud<br>whmcs-gateways<br>whmcs-notifications<br>whmcs-registrars<br>whmcs-reports<br>whmcs-security<br>whmcs-servers<br>whmcs-social<br>whmcs-support<br>whmcs-templates<br>whmcs-includes
Winter CMSwinter-module<br>winter-plugin<br>winter-theme
Wolf CMSwolfcms-plugin
WordPress<b>wordpress-plugin<br>wordpress-theme</b><br>wordpress-muplugin<br>wordpress-dropin
YAWIKyawik-module
Zendzend-library<br>zend-extra<br>zend-module
Zikulazikula-module<br>zikula-theme

Example composer.json File

This is an example for a CakePHP plugin. The only important parts to set in your composer.json file are "type": "cakephp-plugin" which describes what your package is and "require": { "composer/installers": "~1.0" } which tells composer to load the custom installers.

{
    "name": "you/ftp",
    "type": "cakephp-plugin",
    "require": {
        "composer/installers": "~1.0"
    }
}

This would install your package to the Plugin/Ftp/ folder of a CakePHP app when a user runs php composer.phar install.

So submit your packages to packagist.org!

Custom Install Paths

If you are requiring a package which has one of the supported types you can override the install path with the following extra in your composer.json:

{
    "extra": {
        "installer-paths": {
            "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
        }
    }
}

You can determine a non-standard installation path for all packages of a particular type with the type: prefix. The type must be one of types listed on the supported list above.

{
    "extra": {
        "installer-paths": {
            "your/custom/path/{$name}/": ["type:wordpress-plugin"]
        }
    }
}

You can also install all packages by a particular vendor to a custom installation path by using the vendor: prefix. The path will still only apply to packages by the vendor with a type in the supported list.

{
    "extra": {
        "installer-paths": {
            "your/custom/path/{$name}/": ["vendor:my_organization"]
        }
    }
}

These would use your custom path for each of the matching packages. The available variables to use in your paths are: {$name}, {$vendor}, {$type}.

Note: If multiple custom installer-paths match for the same package, the first one which matches will be used.

Custom Install Names

If you're a package author and need your package to be named differently when installed consider using the installer-name extra.

For example you have a package named shama/cakephp-ftp with the type cakephp-plugin. Installing with composer/installers would install to the path Plugin/CakephpFtp. Due to the strict naming conventions, you as a package author actually need the package to be named and installed to Plugin/Ftp. Using the following config within your package composer.json will allow this:

{
    "name": "shama/cakephp-ftp",
    "type": "cakephp-plugin",
    "extra": {
        "installer-name": "Ftp"
    }
}

Please note the name entered into installer-name will be the final and will not be inflected.

Disabling installers

There may be time when you want to disable one or more installers from composer/installers. For example, if you are managing a package or project that uses a framework specific installer that conflicts with composer/installers but also have a dependency on a package that depends on composer/installers.

Installers can be disabled for your project by specifying the extra installer-disable property. If set to true, "all", or "*" all installers will be disabled.

{
    "extra": {
        "installer-disable": true
    }
}

Otherwise a single installer or an array of installers may be specified.

{
    "extra": {
        "installer-disable": [
            "cakephp",
            "drupal"
        ]
    }
}

Note: Using a global disable value (true, "all", or "*") will take precedence over individual installer names if used in an array. The example below will disable all installers.

{
    "extra": {
        "installer-disable": [
          "drupal",
          "all"
        ]
    }
}

Should we allow dynamic package types or paths? No

What are they? The ability for a package author to determine where a package will be installed either through setting the path directly in their composer.json or through a dynamic package type: "type": "framework-install-here".

It has been proposed many times. Even implemented once early on and then removed. Installers won't do this because it would allow a single package author to wipe out entire folders without the user's consent. That user would then come here to yell at us.

Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.