Cotya/magento-composer-installer

Array to string conversion

Opened this issue · 4 comments

Hello!

Problem log

composer run-script post-install-cmd -vvv -- --redeploy
Reading ./composer.json
Loading config file /home/nikus/.composer/config.json
Loading config file /home/nikus/.composer/auth.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/nikus/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading plugin AydinHassan\MagentoCoreComposerInstaller\CoreManager
Loading plugin MagentoHackathon\Composer\Magento\Plugin
you may want to add the packages.firegento.com repository to composer.
add it with: composer.phar config -g repositories.firegento composer http://packages.firegento.com
activate magento plugin
please define your magento root dir [root]



  [ErrorException]            
  Array to string conversion  



Exception trace:
 () at /usr/share/php/Composer/Json/JsonManipulator.php:78
 Composer\Util\ErrorHandler::handle() at /usr/share/php/Composer/Json/JsonManipulator.php:78
 Composer\Json\JsonManipulator->addLink() at /home/nikus/Projects/project/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/ProjectConfig.php:410
 MagentoHackathon\Composer\Magento\ProjectConfig->updateFileCleanly() at /home/nikus/Projects/project/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/ProjectConfig.php:385
 MagentoHackathon\Composer\Magento\ProjectConfig->updateExtraJson() at /home/nikus/Projects/project/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/ProjectConfig.php:356
 MagentoHackathon\Composer\Magento\ProjectConfig->updateExtraConfig() at /home/nikus/Projects/project/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/ProjectConfig.php:141
 MagentoHackathon\Composer\Magento\ProjectConfig->setMagentoRootDir() at /home/nikus/Projects/project/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Helper.php:94
 MagentoHackathon\Composer\Helper::initMagentoRootDir() at /home/nikus/Projects/project/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php:225
 MagentoHackathon\Composer\Magento\Plugin->onNewCodeEvent() at n/a:n/a
 call_user_func() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:151
 Composer\EventDispatcher\EventDispatcher->doDispatch() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:91
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at /usr/share/php/Composer/Command/RunScriptCommand.php:96
 Composer\Command\RunScriptCommand->execute() at /usr/share/php/Symfony/Component/Console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at /usr/share/php/Symfony/Component/Console/Application.php:878
 Symfony\Component\Console\Application->doRunCommand() at /usr/share/php/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:146
 Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:82
 Composer\Console\Application->run() at /usr/bin/composer:44

run-script [--dev] [--no-dev] [-l|--list] [--] [<script>] [<args>]...

Software

Ubuntu 15.10 x64
Composer 1.0.0 (latest build)
PHP 5.6 (cli)

composer.json

{
  "require": {
    "magento-hackathon/magento-composer-installer": "~3.0",
    "aydin-hassan/magento-core-composer-installer": "~1.3",
    "[PRIVATE REPO]/magento-core-ee": "1.13.1.0",
    "opsway/magento-onelogin": "dev-master",
    "dweeves/magmi": "^0.7.22",
    "connect20/aschroder_smtppro": "^2.0.7",
    "avstudnitz/fast-simple-import": "^0.7.0",
    "mage-eag/mage-enhanced-admin-grids": "^0.9.0.1",
    "connect20/catalin_seo": "1.0.2",
    "connect20/et_currencymanager": "^1.0.3",
    "connect20/new_order_admin_email_notification_magestore": "^1.1.2"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "http://packages.firegento.com"
    },
    { 
      "type": "vcs",
      "url": "[PRIVATE REPO]"
    }
  ],
  "extra":{
    "magento-force": true,
    "magento-root-dir": "./",
    "magento-deploystrategy": "copy",
    "magento-deploy-ignore": {
      "*": ["composer.json", "install.php"]
    },
    "magento-core-deploy": {
      "excludes": [
        ".htaccess",
        "app/code/local.xml",
        "errors/local.xml",
        "install.php",
        "composer.json"
      ],
      "git-ignore-append": true
    },
    "auto-append-gitignore": true
  }
}

Used commands

composer -o update
composer run-script post-install-cmd -vvv -- --redeploy

How can I fix this problem?

Fixed!

Don't use "./" as Magento root

Moved root to ./build and it works

It's not fixed. :)
Maybe this should be handled more gracefully.

yes, "./" should be allowed, even if I personally recommend to use "./build"
So I reopen the issue for internal tracking of the issue, sorry for the spam :)