How do I install doctrine / dbal in laravel 5.3?

0

I try to install it by editing my file composer.json in the following way:

"require": {
    "laravel/framework": "5.3.*",
    "doctrine/dbal": "v2.4.5"
},

And then executing the composer update command.

But this throws me the following error:

The version I use is from here: doctrine / dbal

    
asked by Pablo Contreras 07.04.2017 в 00:19
source

1 answer

1

Finally, the answer was in an apparent corruption of the composer installation, or a missing configuration. The solution is described in StackOverflow: composer-content-length-mismatch and includes the following steps:

List composer settings with

composer config --list --global

This will show among other settings the directory that composer considers as [home] . For example

[home] /home/{username}/.composer

Within that directory, you must edit the file config.json to force the use of https when connecting to packagist

{
    "config": {
    "github-protocols": [
      "https"
    ]
  },
  "repositories": {
    "packagist": {
      "type": "composer",
      "url": "https://packagist.org"
    }
  }
}

The answer also suggests adding an entry to the repositories section of the file composer.json of your project. In this case, add packagist explicitly as a repository . An example of how the composer.json of laravel would be included:

{
  "name": "laravel/laravel",
  "description": "The Laravel Framework.",
  "keywords": [
    "framework",
    "laravel"
  ],
  "license": "MIT",
  "type": "project",
  "require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*"
  },
  "config": {
    "preferred-install": "dist"
  },
  "repositories": {
    "packagist": {
      "type": "composer",
      "url": "https://packagist.org"
    }
  }
}

I repeat, I am only replicating what is contained in the answer of S.O. that I linked in my comment.

    
answered by 07.04.2017 / 22:04
source