Symfony - Doctrine Import base existante
Posté : 05 mai 2021, 11:38
Salut tout le monde,
voilà bien longtemps que je n'ai plus posté ici et encore plus longtemps que je n'ai pas posé de question.
Je rencontre un problème avec Doctrine dans un projet : je tente de me mettre à Symfony et plutôt que de créer un projet vide, je reprends un petit site existant. J'ai donc déjà une base de données avec un contenu. Je ne veux pas toucher à cette partie, j'ai donc besoin que tout ce qui est Entity et Repository soit généré à partir de ma base. Je fais ça avec la commande :
En lançant l'import avec un mode plus verbeux, j'obtiens ceci :
Donc en somme, Doctrine tente d'utiliser des classes obsolètes. Et j'ignore totalement comment sortir de ce problème. Si quelqu'un a des idées à me suggérer, ça fait presque deux jours que je suis la-dessus, à fouiller Internet pour trouver une solution. Merci d'avance.
Note : j'ai omis d'indiquer quelques détails sur mon environnement :
OS : Debian
Symfony 5.2.7
DB : MariaDB 15.1
Serveur : Apache 2.4.41;
PHP 7.4.3
voilà bien longtemps que je n'ai plus posté ici et encore plus longtemps que je n'ai pas posé de question.
Je rencontre un problème avec Doctrine dans un projet : je tente de me mettre à Symfony et plutôt que de créer un projet vide, je reprends un petit site existant. J'ai donc déjà une base de données avec un contenu. Je ne veux pas toucher à cette partie, j'ai donc besoin que tout ce qui est Entity et Repository soit généré à partir de ma base. Je fais ça avec la commande :
Code : Tout sélectionner
php bin/console doctrine:mapping:import "App\Entity" annotation --path=src/EntityEn lançant l'import avec un mode plus verbeux, j'obtiens ceci :
Code : Tout sélectionner
#$ php bin/console doctrine:mapping:import -vvv "App\Entity" annotation --path=src/Entity
11:18:21 INFO [php] User Deprecated: Doctrine\ORM\Tools\Export\ClassMetadataExporter is deprecated and will be removed in Doctrine ORM 3.0
[
"exception" => ErrorException {
#message: "User Deprecated: Doctrine\ORM\Tools\Export\ClassMetadataExporter is deprecated and will be removed in Doctrine ORM 3.0"
#code: 0
#file: "./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php"
#line: 48
#severity: E_USER_DEPRECATED
trace: {
./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php:48 { …}
./vendor/doctrine/doctrine-bundle/Command/ImportMappingDoctrineCommand.php:122 { …}
./vendor/symfony/console/Command/Command.php:256 { …}
./vendor/symfony/console/Application.php:989 { …}
./vendor/symfony/framework-bundle/Console/Application.php:96 { …}
./vendor/symfony/console/Application.php:290 { …}
./vendor/symfony/framework-bundle/Console/Application.php:82 { …}
./vendor/symfony/console/Application.php:166 { …}
./bin/console:43 {
› $application = new Application($kernel);
› $application->run($input);
›
}
}
}
]
11:18:21 INFO [php] User Deprecated: Doctrine\ORM\Tools\Export\Driver\AnnotationExporter is deprecated and will be removed in Doctrine ORM 3.0
[
"exception" => ErrorException {
#message: "User Deprecated: Doctrine\ORM\Tools\Export\Driver\AnnotationExporter is deprecated and will be removed in Doctrine ORM 3.0"
#code: 0
#file: "./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php"
#line: 65
#severity: E_USER_DEPRECATED
trace: {
./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php:65 { …}
./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php:82 { …}
./vendor/doctrine/doctrine-bundle/Command/ImportMappingDoctrineCommand.php:123 { …}
./vendor/symfony/console/Command/Command.php:256 { …}
./vendor/symfony/console/Application.php:989 { …}
./vendor/symfony/framework-bundle/Console/Application.php:96 { …}
./vendor/symfony/console/Application.php:290 { …}
./vendor/symfony/framework-bundle/Console/Application.php:82 { …}
./vendor/symfony/console/Application.php:166 { …}
./bin/console:43 {
› $application = new Application($kernel);
› $application->run($input);
›
}
}
}
]
11:18:21 INFO [php] User Deprecated: Doctrine\ORM\Tools\EntityGenerator is deprecated and will be removed in Doctrine ORM 3.0
[
"exception" => ErrorException {
#message: "User Deprecated: Doctrine\ORM\Tools\EntityGenerator is deprecated and will be removed in Doctrine ORM 3.0"
#code: 0
#file: "./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php"
#line: 377
#severity: E_USER_DEPRECATED
trace: {
./vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php:377 { …}
./vendor/doctrine/doctrine-bundle/Command/DoctrineCommand.php:40 { …}
./vendor/doctrine/doctrine-bundle/Command/ImportMappingDoctrineCommand.php:127 { …}
./vendor/symfony/console/Command/Command.php:256 { …}
./vendor/symfony/console/Application.php:989 { …}
./vendor/symfony/framework-bundle/Console/Application.php:96 { …}
./vendor/symfony/console/Application.php:290 { …}
./vendor/symfony/framework-bundle/Console/Application.php:82 { …}
./vendor/symfony/console/Application.php:166 { …}
./bin/console:43 {
› $application = new Application($kernel);
› $application->run($input);
›
}
}
}
]
Database does not have any mapping information.
Note : j'ai omis d'indiquer quelques détails sur mon environnement :
OS : Debian
Symfony 5.2.7
DB : MariaDB 15.1
Serveur : Apache 2.4.41;
PHP 7.4.3