Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Baixe o projeto da aula 6 e não consegui instalaras dependências do projeto

Ao executar o comando composer install na pasta com os arquivos extraídos recebi a mensagem de erro abaixo: o Php instalado está na versão 7.3 e o composer 2.0.

composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - ocramius/package-versions is locked to version 1.3.0 and an update of this package was not requested.
    - ocramius/package-versions 1.3.0 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - symfony/flex is locked to version v1.1.8 and an update of this package was not requested.
    - symfony/flex v1.1.8 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 3
    - ocramius/package-versions 1.3.0 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - ocramius/proxy-manager 2.2.2 requires ocramius/package-versions ^1.1.3 -> satisfiable by ocramius/package-versions[1.3.0].
    - ocramius/proxy-manager is locked to version 2.2.2 and an update of this package was not requested.

ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to suppor
t Composer 2.

Após isso tentei executar o comando: composer update mas recebi a seguinte mensagem de erro:

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!  In ArrayNode.php line 331:
!!  

!!    Unrecognized options "dir_name, namespace" under "doctrine_migrations". Available options are "all_or_nothing", "check_database_platform", "connection", "cus
t
!!    om_template", "em", "factories", "migrations", "migrations_paths", "organize_migrations", "services", "storage".

!!  

!!
!!
Script @auto-scripts was called via post-update-cmd

O que eu preciso fazer para poder continuar o projeto a partir desta aula?

2 respostas

O erro no composer install:

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to suppor t Composer 2.

Ou seja, algum plugin na versão que eu usei no curso não funciona com o Composer 2. Provavelmente já foi atualizado pois no seu composer update você recebe outro erro.

Sobre esse segundo erro, é um problema de compatibilidade entre o formato das configurações da versão 2 pra 3 do pacote Doctrine Migrations. Vê se alguma dessas soluções resolvem pra você:

https://github.com/doctrine/DoctrineMigrationsBundle/issues/301

Ou você pode atualizar seu arquivo de configuração: https://symfony.com/doc/3.1/bundles/DoctrineMigrationsBundle/index.html

solução!

Esta modificação realizada no doctrine_migrations.yaml file : https://github.com/doctrine/DoctrineMigrationsBundle/blob/master/UPGRADE.md

The configuration for the migration namespace and directory changed as follows:
Before

doctrine_migrations:
    dir_name: '%kernel.project_dir%/src/Migrations'
    namespace: DoctrineMigrations
After

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

Aparentemente resolveu o problema. Após isso pude instalar as dependências com o composer e apagar, criar um novo banco de dados para poder realizar o migrate.