johnpbloch / wordpress-core-installer

A composer installer for WordPress core so I can stop saying core is a wordpress-plugin type package.
https://packagist.org/packages/johnpbloch/wordpress-core-installer
GNU General Public License v2.0
207 stars 49 forks source link

Fails in project with packages using composer/installers #3

Closed Rarst closed 11 years ago

Rarst commented 11 years ago

Install fails if core package, using core installer, is used alongside other package, using composer/installers.

composer.json

{
    "name"        : "rarst/core-install-test",
    "repositories": [
        {
            "type": "composer",
            "url" : "http://wpackagist.org"
        },
        {
            "type"   : "package",
            "package": {
                "name"   : "rarst/wordpress",
                "type"   : "wordpress-core",
                "version": "3.6",
                "dist"   : {
                    "url" : "http://wordpress.org/wordpress-3.6.zip",
                    "type": "zip"
                },
                "source" : {
                    "url"      : "https://github.com/WordPress/WordPress",
                    "type"     : "git",
                    "reference": "3.6"
                },
                "require": {
                    "johnpbloch/wordpress-core-installer": "~0.1"
                }
            }
        }
    ],
    "require"     : {
        "rarst/wordpress"                  : ">=3.6",
        "wpackagist/toolbar-theme-switcher": "*"
    }
}

Install log ends up in


  [InvalidArgumentException]
  Package type "wordpress-core" is not supported

Exception trace:
 () at C:\server\core-installer-test\vendor\composer\installers\src\Composer\Installers\BaseInstaller.php:63
 Composer\Installers\BaseInstaller->getInstallPath() at C:\server\core-installer-test\vendor\composer\installers\src\Composer\Installers\Installer.php:58
 Composer\Installers\Installer->getInstallPath() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Installer/LibraryInstaller.php:79
 Composer\Installer\LibraryInstaller->install() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Installer/InstallationManager.php:151
 Composer\Installer\InstallationManager->install() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Installer/InstallationManager.php:138
 Composer\Installer\InstallationManager->execute() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Installer.php:509
 Composer\Installer->doInstall() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Installer.php:210
 Composer\Installer->run() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Command/InstallCommand.php:97
 Composer\Command\InstallCommand->execute() at phar://C:/ProgramData/Composer/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/Composer/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:897
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/Composer/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:191
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Console/Application.php:117
 Composer\Console\Application->doRun() at phar://C:/ProgramData/Composer/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/Composer/bin/composer.phar/src/Composer/Console/Application.php:83
 Composer\Console\Application->run() at phar://C:/ProgramData/Composer/bin/composer.phar/bin/composer:43
 require() at C:\ProgramData\Composer\bin\composer.phar:15
johnpbloch commented 11 years ago

This is because of how composer-installers handles packages. Basically, they seem to have "reserved" ANY type that starts with wordpress- and will throw an exception if it's not one of the types they have allowed.

I'm not sure what the best course of action is, but it seems to me we have two possibilities:

  1. Change the installer type from wordpress-core to something like wp-core or core-wordpress
  2. Get composer-installer to change their package to allow other packages to extend the available package types
johnpbloch commented 11 years ago

Ok, I opened an issue at composer/installers#98 asking them to stop hijacking wordpress-* types. We'll see where it goes, if anywhere.