From b2b3e213896d7eb41a83b0b0011aa64171a917cc Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 04:47:43 -0800 Subject: [PATCH 01/12] Add ability to disable individual or all installers --- src/Composer/Installers/Installer.php | 64 +++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index 691a2e54..01693ebe 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -102,6 +102,30 @@ class Installer extends LibraryInstaller 'prestashop' => 'PrestashopInstaller' ); + /** + * Installer constructor. + * + * Disables installers specified in main composer extra installer-disable + * list + * + * @param IOInterface $io + * @param \Composer\Composer $composer + * @param string $type + * @param \Composer\Util\Filesystem|null $filesystem + * @param \Composer\Installer\BinaryInstaller|null $binaryInstaller + */ + public function __construct( + \Composer\IO\IOInterface $io, + \Composer\Composer $composer, + $type = 'library', + \Composer\Util\Filesystem $filesystem = null, + \Composer\Installer\BinaryInstaller $binaryInstaller = null + ) { + parent::__construct($io, $composer, $type, $filesystem, + $binaryInstaller); + $this->removeDisabledInstallers(); + } + /** * {@inheritDoc} */ @@ -197,4 +221,44 @@ private function getIO() { return $this->io; } + + /** + * Look for installers set to be disabled in composer's extra config and + * remove them from the list of supported installers. + * Uses true, "all", and "*" as global values to disable all installers. + * + * @return void + */ + protected function removeDisabledInstallers() + { + $extra = $this->composer->getPackage()->getExtra(); + + if (!isset($extra['installer-disable'])) { + // No installers are disabled + return; + } + + // Get installers to disable + $disable = $extra['installer-disable']; + + // Ensure $disabled is an array + if (!is_array($disable)) { + $disable = array($disable); + } + + // Check which installers should be disabled + $all = array(true, "all", "*"); + $intersect = array_intersect($all, $disable); + if (!empty($intersect)) { + // Disable all installers + $this->supportedTypes = array(); + } else { + // Disable specified installers + foreach ($disable as $key => $installer) { + if (key_exists($installer, $this->supportedTypes)) { + unset($this->supportedTypes[$installer]); + } + } + } + } } From 4c60bc5f51835d019bc24ecc1fc05d07a2d700e6 Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 04:47:58 -0800 Subject: [PATCH 02/12] Add documentation for how to disable installers --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0e1790b..b0bb1e0a 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ is not needed to install packages with these frameworks: | Decibel | `decibel-app` | DokuWiki | `dokuwiki-plugin`
`dokuwiki-template` | Dolibarr | `dolibarr-module` -| Drupal | `drupal-core`
`drupal-module`
`drupal-theme`

`drupal-library`
`drupal-profile`
`drupal-drush` +| Drupal | `drupal-core`
`drupal-module`
`drupal-theme`

`drupal-library`
`drupal-profile`
`drupal-drush`
`drupal-custom-theme`
`drupal-custom-module` | Elgg | `elgg-plugin` | Eliasis | `eliasis-component`
`eliasis-module`
`eliasis-plugin`
`eliasis-template` | ExpressionEngine 3 | `ee3-addon`
`ee3-theme` @@ -205,6 +205,51 @@ will allow this: 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. + +```json +{ + "extra": { + "installer-disable": true + } +} +``` + +Otherwise a single installer or an array of installers may be specified. + +```json +{ + "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. + +```json +{ + "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 From a0e7405a4c7ccb706d863738e3cd3d9e786d0a00 Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 04:48:41 -0800 Subject: [PATCH 03/12] Update for consistent PSR-2 formatting and remove unused "use" statement --- src/Composer/Installers/Installer.php | 197 ++++++++++++++------------ 1 file changed, 103 insertions(+), 94 deletions(-) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index 01693ebe..c62f0047 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -1,105 +1,106 @@ 'AimeosInstaller', - 'asgard' => 'AsgardInstaller', - 'attogram' => 'AttogramInstaller', - 'agl' => 'AglInstaller', - 'annotatecms' => 'AnnotateCmsInstaller', - 'bitrix' => 'BitrixInstaller', - 'bonefish' => 'BonefishInstaller', - 'cakephp' => 'CakePHPInstaller', - 'chef' => 'ChefInstaller', - 'ccframework' => 'ClanCatsFrameworkInstaller', - 'cockpit' => 'CockpitInstaller', - 'codeigniter' => 'CodeIgniterInstaller', - 'concrete5' => 'Concrete5Installer', - 'craft' => 'CraftInstaller', - 'croogo' => 'CroogoInstaller', - 'dokuwiki' => 'DokuWikiInstaller', - 'dolibarr' => 'DolibarrInstaller', - 'decibel' => 'DecibelInstaller', - 'drupal' => 'DrupalInstaller', - 'elgg' => 'ElggInstaller', - 'eliasis' => 'EliasisInstaller', - 'ee3' => 'ExpressionEngineInstaller', - 'ee2' => 'ExpressionEngineInstaller', - 'ezplatform' => 'EzPlatformInstaller', - 'fuel' => 'FuelInstaller', - 'fuelphp' => 'FuelphpInstaller', - 'grav' => 'GravInstaller', - 'hurad' => 'HuradInstaller', - 'imagecms' => 'ImageCMSInstaller', - 'itop' => 'ItopInstaller', - 'joomla' => 'JoomlaInstaller', - 'kanboard' => 'KanboardInstaller', - 'kirby' => 'KirbyInstaller', - 'kodicms' => 'KodiCMSInstaller', - 'kohana' => 'KohanaInstaller', - 'lms' => 'LanManagementSystemInstaller', - 'laravel' => 'LaravelInstaller', - 'lavalite' => 'LavaLiteInstaller', - 'lithium' => 'LithiumInstaller', - 'magento' => 'MagentoInstaller', - 'majima' => 'MajimaInstaller', - 'mako' => 'MakoInstaller', - 'maya' => 'MayaInstaller', - 'mautic' => 'MauticInstaller', - 'mediawiki' => 'MediaWikiInstaller', - 'microweber' => 'MicroweberInstaller', - 'modulework' => 'MODULEWorkInstaller', - 'modx' => 'ModxInstaller', - 'modxevo' => 'MODXEvoInstaller', - 'moodle' => 'MoodleInstaller', - 'october' => 'OctoberInstaller', - 'ontowiki' => 'OntoWikiInstaller', - 'oxid' => 'OxidInstaller', - 'osclass' => 'OsclassInstaller', - 'pxcms' => 'PxcmsInstaller', - 'phpbb' => 'PhpBBInstaller', - 'pimcore' => 'PimcoreInstaller', - 'piwik' => 'PiwikInstaller', - 'plentymarkets'=> 'PlentymarketsInstaller', - 'ppi' => 'PPIInstaller', - 'puppet' => 'PuppetInstaller', - 'radphp' => 'RadPHPInstaller', - 'phifty' => 'PhiftyInstaller', - 'porto' => 'PortoInstaller', - 'redaxo' => 'RedaxoInstaller', - 'reindex' => 'ReIndexInstaller', - 'roundcube' => 'RoundcubeInstaller', - 'shopware' => 'ShopwareInstaller', - 'silverstripe' => 'SilverStripeInstaller', - 'smf' => 'SMFInstaller', - 'sydes' => 'SyDESInstaller', - 'symfony1' => 'Symfony1Installer', - 'thelia' => 'TheliaInstaller', - 'tusk' => 'TuskInstaller', - 'typo3-cms' => 'TYPO3CmsInstaller', - 'typo3-flow' => 'TYPO3FlowInstaller', - 'userfrosting' => 'UserFrostingInstaller', - 'vanilla' => 'VanillaInstaller', - 'whmcs' => 'WHMCSInstaller', - 'wolfcms' => 'WolfCMSInstaller', - 'wordpress' => 'WordPressInstaller', - 'yawik' => 'YawikInstaller', - 'zend' => 'ZendInstaller', - 'zikula' => 'ZikulaInstaller', - 'prestashop' => 'PrestashopInstaller' + 'aimeos' => 'AimeosInstaller', + 'asgard' => 'AsgardInstaller', + 'attogram' => 'AttogramInstaller', + 'agl' => 'AglInstaller', + 'annotatecms' => 'AnnotateCmsInstaller', + 'bitrix' => 'BitrixInstaller', + 'bonefish' => 'BonefishInstaller', + 'cakephp' => 'CakePHPInstaller', + 'chef' => 'ChefInstaller', + 'ccframework' => 'ClanCatsFrameworkInstaller', + 'cockpit' => 'CockpitInstaller', + 'codeigniter' => 'CodeIgniterInstaller', + 'concrete5' => 'Concrete5Installer', + 'craft' => 'CraftInstaller', + 'croogo' => 'CroogoInstaller', + 'dokuwiki' => 'DokuWikiInstaller', + 'dolibarr' => 'DolibarrInstaller', + 'decibel' => 'DecibelInstaller', + 'drupal' => 'DrupalInstaller', + 'elgg' => 'ElggInstaller', + 'eliasis' => 'EliasisInstaller', + 'ee3' => 'ExpressionEngineInstaller', + 'ee2' => 'ExpressionEngineInstaller', + 'ezplatform' => 'EzPlatformInstaller', + 'fuel' => 'FuelInstaller', + 'fuelphp' => 'FuelphpInstaller', + 'grav' => 'GravInstaller', + 'hurad' => 'HuradInstaller', + 'imagecms' => 'ImageCMSInstaller', + 'itop' => 'ItopInstaller', + 'joomla' => 'JoomlaInstaller', + 'kanboard' => 'KanboardInstaller', + 'kirby' => 'KirbyInstaller', + 'kodicms' => 'KodiCMSInstaller', + 'kohana' => 'KohanaInstaller', + 'lms' => 'LanManagementSystemInstaller', + 'laravel' => 'LaravelInstaller', + 'lavalite' => 'LavaLiteInstaller', + 'lithium' => 'LithiumInstaller', + 'magento' => 'MagentoInstaller', + 'majima' => 'MajimaInstaller', + 'mako' => 'MakoInstaller', + 'maya' => 'MayaInstaller', + 'mautic' => 'MauticInstaller', + 'mediawiki' => 'MediaWikiInstaller', + 'microweber' => 'MicroweberInstaller', + 'modulework' => 'MODULEWorkInstaller', + 'modx' => 'ModxInstaller', + 'modxevo' => 'MODXEvoInstaller', + 'moodle' => 'MoodleInstaller', + 'october' => 'OctoberInstaller', + 'ontowiki' => 'OntoWikiInstaller', + 'oxid' => 'OxidInstaller', + 'osclass' => 'OsclassInstaller', + 'pxcms' => 'PxcmsInstaller', + 'phpbb' => 'PhpBBInstaller', + 'pimcore' => 'PimcoreInstaller', + 'piwik' => 'PiwikInstaller', + 'plentymarkets' => 'PlentymarketsInstaller', + 'ppi' => 'PPIInstaller', + 'puppet' => 'PuppetInstaller', + 'radphp' => 'RadPHPInstaller', + 'phifty' => 'PhiftyInstaller', + 'porto' => 'PortoInstaller', + 'redaxo' => 'RedaxoInstaller', + 'reindex' => 'ReIndexInstaller', + 'roundcube' => 'RoundcubeInstaller', + 'shopware' => 'ShopwareInstaller', + 'silverstripe' => 'SilverStripeInstaller', + 'smf' => 'SMFInstaller', + 'sydes' => 'SyDESInstaller', + 'symfony1' => 'Symfony1Installer', + 'thelia' => 'TheliaInstaller', + 'tusk' => 'TuskInstaller', + 'typo3-cms' => 'TYPO3CmsInstaller', + 'typo3-flow' => 'TYPO3FlowInstaller', + 'userfrosting' => 'UserFrostingInstaller', + 'vanilla' => 'VanillaInstaller', + 'whmcs' => 'WHMCSInstaller', + 'wolfcms' => 'WolfCMSInstaller', + 'wordpress' => 'WordPressInstaller', + 'yawik' => 'YawikInstaller', + 'zend' => 'ZendInstaller', + 'zikula' => 'ZikulaInstaller', + 'prestashop' => 'PrestashopInstaller', ); /** @@ -146,11 +147,14 @@ public function getInstallPath(PackageInterface $package) return $installer->getInstallPath($package, $frameworkType); } - public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) - { + public function uninstall( + InstalledRepositoryInterface $repo, + PackageInterface $package + ) { parent::uninstall($repo, $package); $installPath = $this->getPackageBasePath($package); - $this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? 'deleted' : 'not deleted')); + $this->io->write(sprintf('Deleting %s - %s', $installPath, + !file_exists($installPath) ? 'deleted' : 'not deleted')); } /** @@ -166,13 +170,15 @@ public function supports($packageType) $locationPattern = $this->getLocationPattern($frameworkType); - return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1; + return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', + $packageType, $matches) === 1; } /** * Finds a supported framework type if it exists and returns it * * @param string $type + * * @return string */ protected function findFrameworkType($type) @@ -196,6 +202,7 @@ protected function findFrameworkType($type) * package type * * @param string $frameworkType + * * @return string */ protected function getLocationPattern($frameworkType) @@ -204,12 +211,14 @@ protected function getLocationPattern($frameworkType) if (!empty($this->supportedTypes[$frameworkType])) { $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType]; /** @var BaseInstaller $framework */ - $framework = new $frameworkClass(null, $this->composer, $this->getIO()); + $framework = new $frameworkClass(null, $this->composer, + $this->getIO()); $locations = array_keys($framework->getLocations()); - $pattern = $locations ? '(' . implode('|', $locations) . ')' : false; + $pattern = $locations ? '(' . implode('|', + $locations) . ')' : false; } - return $pattern ? : '(\w+)'; + return $pattern ?: '(\w+)'; } /** From 9676c9b9a682004393d23e2318897b9507503e1e Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 05:01:25 -0800 Subject: [PATCH 04/12] Make path for Drupal custom modules consistent --- src/Composer/Installers/DrupalInstaller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Installers/DrupalInstaller.php b/src/Composer/Installers/DrupalInstaller.php index a41ee2e1..fef7c525 100644 --- a/src/Composer/Installers/DrupalInstaller.php +++ b/src/Composer/Installers/DrupalInstaller.php @@ -11,6 +11,6 @@ class DrupalInstaller extends BaseInstaller 'profile' => 'profiles/{$name}/', 'drush' => 'drush/{$name}/', 'custom-theme' => 'themes/custom/{$name}/', - 'custom-module' => 'modules/custom/{$name}', + 'custom-module' => 'modules/custom/{$name}/', ); } From 08818223632cc0cc9dcd41e208582d15921d6ebb Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 05:01:43 -0800 Subject: [PATCH 05/12] Add testing for all drupal types --- .../Composer/Installers/Test/InstallerTest.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/Composer/Installers/Test/InstallerTest.php b/tests/Composer/Installers/Test/InstallerTest.php index 75b402b6..38a2febd 100644 --- a/tests/Composer/Installers/Test/InstallerTest.php +++ b/tests/Composer/Installers/Test/InstallerTest.php @@ -116,7 +116,14 @@ public function dataForTestSupport() array('decibel-app', true), array('dokuwiki-plugin', true), array('dokuwiki-template', true), + array('drupal-core', true), array('drupal-module', true), + array('drupal-theme', true), + array('drupal-library', true), + array('drupal-profile', true), + array('drupal-drush', true), + array('drupal-custom-theme', true), + array('drupal-custom-module', true), array('dolibarr-module', true), array('ee3-theme', true), array('ee3-addon', true), @@ -279,10 +286,14 @@ public function dataForTestInstallPath() array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'), array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'), array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'), + array('drupal-core', 'core/', 'drupal/core'), array('drupal-module', 'modules/my_module/', 'shama/my_module'), - array('drupal-theme', 'themes/my_module/', 'shama/my_module'), - array('drupal-profile', 'profiles/my_module/', 'shama/my_module'), - array('drupal-drush', 'drush/my_module/', 'shama/my_module'), + array('drupal-theme', 'themes/my_theme/', 'shama/my_theme'), + array('drupal-library', 'libraries/my_library/', 'shama/my_library'), + array('drupal-profile', 'profiles/my_profile/', 'shama/my_profile'), + array('drupal-drush', 'drush/my_command/', 'shama/my_command'), + array('drupal-custom-theme', 'themes/custom/my_theme/', 'shama/my_theme'), + array('drupal-custom-module', 'modules/custom/my_module/', 'shama/my_module'), array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'), array('eliasis-component', 'components/my_component/', 'shama/my_component'), array('eliasis-module', 'modules/my_module/', 'shama/my_module'), From ee686c90679adf206cabf968164baa397ed5b88e Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 05:48:23 -0800 Subject: [PATCH 06/12] Enforce installers are specified as strings --- src/Composer/Installers/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index c62f0047..1861e2a8 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -264,7 +264,7 @@ protected function removeDisabledInstallers() } else { // Disable specified installers foreach ($disable as $key => $installer) { - if (key_exists($installer, $this->supportedTypes)) { + if (is_string($installer) && key_exists($installer, $this->supportedTypes)) { unset($this->supportedTypes[$installer]); } } From 7f10a3e5fd20c1dc0bb91b9692ef454f95ff4018 Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 05:49:30 -0800 Subject: [PATCH 07/12] Update tests to create default composer package in setup --- .../Installers/Test/InstallerTest.php | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/Composer/Installers/Test/InstallerTest.php b/tests/Composer/Installers/Test/InstallerTest.php index 38a2febd..420067d7 100644 --- a/tests/Composer/Installers/Test/InstallerTest.php +++ b/tests/Composer/Installers/Test/InstallerTest.php @@ -1,12 +1,12 @@ repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface'); $this->io = $this->getMock('Composer\IO\IOInterface'); + + $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0'); + $this->composer->setPackage($consumerPackage); + } /** @@ -444,9 +448,7 @@ public function testCustomInstallPath() $installer = new Installer($this->io, $this->composer); $package = new Package('shama/ftp', '1.0.0', '1.0.0'); $package->setType('cakephp-plugin'); - $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0'); - $this->composer->setPackage($consumerPackage); - $consumerPackage->setExtra(array( + $this->composer->getPackage()->setExtra(array( 'installer-paths' => array( 'my/custom/path/{$name}/' => array( 'shama/ftp', @@ -481,9 +483,7 @@ public function testCustomTypePath() $installer = new Installer($this->io, $this->composer); $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0'); $package->setType('wordpress-plugin'); - $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0'); - $this->composer->setPackage($consumerPackage); - $consumerPackage->setExtra(array( + $this->composer->getPackage()->setExtra(array( 'installer-paths' => array( 'my/custom/path/{$name}/' => array( 'type:wordpress-plugin' @@ -502,9 +502,7 @@ public function testVendorPath() $installer = new Installer($this->io, $this->composer); $package = new Package('penyaskito/my_module', '1.0.0', '1.0.0'); $package->setType('drupal-module'); - $consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0'); - $this->composer->setPackage($consumerPackage); - $consumerPackage->setExtra(array( + $this->composer->getPackage()->setExtra(array( 'installer-paths' => array( 'modules/custom/{$name}/' => array( 'vendor:penyaskito' From d7d670463a82dfa34c8e14c8d04226618918d698 Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 7 Nov 2017 05:49:42 -0800 Subject: [PATCH 08/12] Add tests for disabling installers --- .../Installers/Test/InstallerTest.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/Composer/Installers/Test/InstallerTest.php b/tests/Composer/Installers/Test/InstallerTest.php index 420067d7..5bc855b0 100644 --- a/tests/Composer/Installers/Test/InstallerTest.php +++ b/tests/Composer/Installers/Test/InstallerTest.php @@ -558,4 +558,44 @@ public function testUninstallAndDeletePackageFromLocalRepo() $installer->uninstall($repo, $package); } + + /** + * testDisabledInstallers + * + * @dataProvider dataForTestDisabledInstallers + */ + public function testDisabledInstallers($disabled, $type, $expected) + { + $this->composer->getPackage()->setExtra(array( + 'installer-disable' => $disabled, + )); + $this->testSupports($type, $expected); + } + + /** + * dataForTestDisabledInstallers + * + * @return array + */ + public function dataForTestDisabledInstallers() + { + return array( + array(false, "drupal-module", true), + array(true, "drupal-module", false), + array("true", "drupal-module", true), + array("all", "drupal-module", false), + array("*", "drupal-module", false), + array("cakephp", "drupal-module", true), + array("drupal", "cakephp-plugin", true), + array("cakephp", "cakephp-plugin", false), + array("drupal", "drupal-module", false), + array(array("drupal", "cakephp"), "cakephp-plugin", false), + array(array("drupal", "cakephp"), "drupal-module", false), + array(array("cakephp", true), "drupal-module", false), + array(array("cakephp", "all"), "drupal-module", false), + array(array("cakephp", "*"), "drupal-module", false), + array(array("cakephp", "true"), "drupal-module", true), + array(array("drupal", "true"), "cakephp-plugin", true), + ); + } } From 94ee5b9f77fc93fab69941c4fef3a4942407fc2c Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Tue, 12 Dec 2017 07:47:17 -0800 Subject: [PATCH 09/12] Remove unnecessary formatting changes --- src/Composer/Installers/Installer.php | 172 +++++++++++++------------- 1 file changed, 85 insertions(+), 87 deletions(-) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index 1ba43b58..dbac95b6 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -1,5 +1,4 @@ 'AimeosInstaller', - 'asgard' => 'AsgardInstaller', - 'attogram' => 'AttogramInstaller', - 'agl' => 'AglInstaller', - 'annotatecms' => 'AnnotateCmsInstaller', - 'bitrix' => 'BitrixInstaller', - 'bonefish' => 'BonefishInstaller', - 'cakephp' => 'CakePHPInstaller', - 'chef' => 'ChefInstaller', - 'ccframework' => 'ClanCatsFrameworkInstaller', - 'cockpit' => 'CockpitInstaller', - 'codeigniter' => 'CodeIgniterInstaller', - 'concrete5' => 'Concrete5Installer', - 'craft' => 'CraftInstaller', - 'croogo' => 'CroogoInstaller', - 'dokuwiki' => 'DokuWikiInstaller', - 'dolibarr' => 'DolibarrInstaller', - 'decibel' => 'DecibelInstaller', - 'drupal' => 'DrupalInstaller', - 'elgg' => 'ElggInstaller', - 'eliasis' => 'EliasisInstaller', - 'ee3' => 'ExpressionEngineInstaller', - 'ee2' => 'ExpressionEngineInstaller', - 'ezplatform' => 'EzPlatformInstaller', - 'fuel' => 'FuelInstaller', - 'fuelphp' => 'FuelphpInstaller', - 'grav' => 'GravInstaller', - 'hurad' => 'HuradInstaller', - 'imagecms' => 'ImageCMSInstaller', - 'itop' => 'ItopInstaller', - 'joomla' => 'JoomlaInstaller', - 'kanboard' => 'KanboardInstaller', - 'kirby' => 'KirbyInstaller', - 'kodicms' => 'KodiCMSInstaller', - 'kohana' => 'KohanaInstaller', - 'lms' => 'LanManagementSystemInstaller', - 'laravel' => 'LaravelInstaller', - 'lavalite' => 'LavaLiteInstaller', - 'lithium' => 'LithiumInstaller', - 'magento' => 'MagentoInstaller', - 'majima' => 'MajimaInstaller', - 'mako' => 'MakoInstaller', - 'maya' => 'MayaInstaller', - 'mautic' => 'MauticInstaller', - 'mediawiki' => 'MediaWikiInstaller', - 'microweber' => 'MicroweberInstaller', - 'modulework' => 'MODULEWorkInstaller', - 'modx' => 'ModxInstaller', - 'modxevo' => 'MODXEvoInstaller', - 'moodle' => 'MoodleInstaller', - 'october' => 'OctoberInstaller', - 'ontowiki' => 'OntoWikiInstaller', - 'oxid' => 'OxidInstaller', - 'osclass' => 'OsclassInstaller', - 'pxcms' => 'PxcmsInstaller', - 'phpbb' => 'PhpBBInstaller', - 'pimcore' => 'PimcoreInstaller', - 'piwik' => 'PiwikInstaller', - 'plentymarkets' => 'PlentymarketsInstaller', - 'ppi' => 'PPIInstaller', - 'puppet' => 'PuppetInstaller', - 'radphp' => 'RadPHPInstaller', - 'phifty' => 'PhiftyInstaller', - 'porto' => 'PortoInstaller', - 'redaxo' => 'RedaxoInstaller', - 'reindex' => 'ReIndexInstaller', - 'roundcube' => 'RoundcubeInstaller', - 'shopware' => 'ShopwareInstaller', + 'aimeos' => 'AimeosInstaller', + 'asgard' => 'AsgardInstaller', + 'attogram' => 'AttogramInstaller', + 'agl' => 'AglInstaller', + 'annotatecms' => 'AnnotateCmsInstaller', + 'bitrix' => 'BitrixInstaller', + 'bonefish' => 'BonefishInstaller', + 'cakephp' => 'CakePHPInstaller', + 'chef' => 'ChefInstaller', + 'ccframework' => 'ClanCatsFrameworkInstaller', + 'cockpit' => 'CockpitInstaller', + 'codeigniter' => 'CodeIgniterInstaller', + 'concrete5' => 'Concrete5Installer', + 'craft' => 'CraftInstaller', + 'croogo' => 'CroogoInstaller', + 'dokuwiki' => 'DokuWikiInstaller', + 'dolibarr' => 'DolibarrInstaller', + 'decibel' => 'DecibelInstaller', + 'drupal' => 'DrupalInstaller', + 'elgg' => 'ElggInstaller', + 'eliasis' => 'EliasisInstaller', + 'ee3' => 'ExpressionEngineInstaller', + 'ee2' => 'ExpressionEngineInstaller', + 'ezplatform' => 'EzPlatformInstaller', + 'fuel' => 'FuelInstaller', + 'fuelphp' => 'FuelphpInstaller', + 'grav' => 'GravInstaller', + 'hurad' => 'HuradInstaller', + 'imagecms' => 'ImageCMSInstaller', + 'itop' => 'ItopInstaller', + 'joomla' => 'JoomlaInstaller', + 'kanboard' => 'KanboardInstaller', + 'kirby' => 'KirbyInstaller', + 'kodicms' => 'KodiCMSInstaller', + 'kohana' => 'KohanaInstaller', + 'lms' => 'LanManagementSystemInstaller', + 'laravel' => 'LaravelInstaller', + 'lavalite' => 'LavaLiteInstaller', + 'lithium' => 'LithiumInstaller', + 'magento' => 'MagentoInstaller', + 'majima' => 'MajimaInstaller', + 'mako' => 'MakoInstaller', + 'maya' => 'MayaInstaller', + 'mautic' => 'MauticInstaller', + 'mediawiki' => 'MediaWikiInstaller', + 'microweber' => 'MicroweberInstaller', + 'modulework' => 'MODULEWorkInstaller', + 'modx' => 'ModxInstaller', + 'modxevo' => 'MODXEvoInstaller', + 'moodle' => 'MoodleInstaller', + 'october' => 'OctoberInstaller', + 'ontowiki' => 'OntoWikiInstaller', + 'oxid' => 'OxidInstaller', + 'osclass' => 'OsclassInstaller', + 'pxcms' => 'PxcmsInstaller', + 'phpbb' => 'PhpBBInstaller', + 'pimcore' => 'PimcoreInstaller', + 'piwik' => 'PiwikInstaller', + 'plentymarkets'=> 'PlentymarketsInstaller', + 'ppi' => 'PPIInstaller', + 'puppet' => 'PuppetInstaller', + 'radphp' => 'RadPHPInstaller', + 'phifty' => 'PhiftyInstaller', + 'porto' => 'PortoInstaller', + 'redaxo' => 'RedaxoInstaller', + 'reindex' => 'ReIndexInstaller', + 'roundcube' => 'RoundcubeInstaller', + 'shopware' => 'ShopwareInstaller', 'sitedirect' => 'SiteDirectInstaller', - 'silverstripe' => 'SilverStripeInstaller', - 'smf' => 'SMFInstaller', - 'sydes' => 'SyDESInstaller', - 'symfony1' => 'Symfony1Installer', - 'thelia' => 'TheliaInstaller', - 'tusk' => 'TuskInstaller', - 'typo3-cms' => 'TYPO3CmsInstaller', - 'typo3-flow' => 'TYPO3FlowInstaller', - 'userfrosting' => 'UserFrostingInstaller', - 'vanilla' => 'VanillaInstaller', - 'whmcs' => 'WHMCSInstaller', - 'wolfcms' => 'WolfCMSInstaller', - 'wordpress' => 'WordPressInstaller', - 'yawik' => 'YawikInstaller', - 'zend' => 'ZendInstaller', - 'zikula' => 'ZikulaInstaller', - 'prestashop' => 'PrestashopInstaller', + 'silverstripe' => 'SilverStripeInstaller', + 'smf' => 'SMFInstaller', + 'sydes' => 'SyDESInstaller', + 'symfony1' => 'Symfony1Installer', + 'thelia' => 'TheliaInstaller', + 'tusk' => 'TuskInstaller', + 'typo3-cms' => 'TYPO3CmsInstaller', + 'typo3-flow' => 'TYPO3FlowInstaller', + 'userfrosting' => 'UserFrostingInstaller', + 'vanilla' => 'VanillaInstaller', + 'whmcs' => 'WHMCSInstaller', + 'wolfcms' => 'WolfCMSInstaller', + 'wordpress' => 'WordPressInstaller', + 'yawik' => 'YawikInstaller', + 'zend' => 'ZendInstaller', + 'zikula' => 'ZikulaInstaller', + 'prestashop' => 'PrestashopInstaller' ); /** From 38061358f2d56aefbbd11a4fd03018f1c1546f9d Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Fri, 9 Feb 2018 08:33:30 -0800 Subject: [PATCH 10/12] Update documentation to include false option --- src/Composer/Installers/Installer.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index dbe645a5..3fa063dd 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -1,13 +1,15 @@ Date: Fri, 9 Feb 2018 08:35:46 -0800 Subject: [PATCH 11/12] Add false as an option to prevent installers from being disabled. --- src/Composer/Installers/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index 3fa063dd..f4b4044e 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -240,7 +240,7 @@ protected function removeDisabledInstallers() { $extra = $this->composer->getPackage()->getExtra(); - if (!isset($extra['installer-disable'])) { + if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) { // No installers are disabled return; } From 78eb8ca263660fb95313957d7b24f919188970ab Mon Sep 17 00:00:00 2001 From: Thom Williams Date: Thu, 5 Apr 2018 08:39:47 -0700 Subject: [PATCH 12/12] Add use statements in place of fully qualified namespaces --- src/Composer/Installers/Installer.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Composer/Installers/Installer.php b/src/Composer/Installers/Installer.php index f4b4044e..352cb7fa 100644 --- a/src/Composer/Installers/Installer.php +++ b/src/Composer/Installers/Installer.php @@ -2,10 +2,13 @@ namespace Composer\Installers; +use Composer\Composer; +use Composer\Installer\BinaryInstaller; use Composer\Installer\LibraryInstaller; use Composer\IO\IOInterface; use Composer\Package\PackageInterface; use Composer\Repository\InstalledRepositoryInterface; +use Composer\Util\Filesystem; class Installer extends LibraryInstaller { @@ -111,18 +114,18 @@ class Installer extends LibraryInstaller * Disables installers specified in main composer extra installer-disable * list * - * @param IOInterface $io - * @param \Composer\Composer $composer - * @param string $type - * @param \Composer\Util\Filesystem|null $filesystem - * @param \Composer\Installer\BinaryInstaller|null $binaryInstaller + * @param IOInterface $io + * @param Composer $composer + * @param string $type + * @param Filesystem|null $filesystem + * @param BinaryInstaller|null $binaryInstaller */ public function __construct( - \Composer\IO\IOInterface $io, - \Composer\Composer $composer, + IOInterface $io, + Composer $composer, $type = 'library', - \Composer\Util\Filesystem $filesystem = null, - \Composer\Installer\BinaryInstaller $binaryInstaller = null + Filesystem $filesystem = null, + BinaryInstaller $binaryInstaller = null ) { parent::__construct($io, $composer, $type, $filesystem, $binaryInstaller);