Gente estou tentando implementar o arquivo cli-config.php só que está dando um erro já tentei muitas coisas se algume souber o que está acontecendo.
<?php
use Dotenv\Dotenv;
use DI\ContainerBuilder;
use Doctrine\ORM\ORMSetup;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\DBAL\DriverManager;
use Doctrine\Migrations\DependencyFactory;
use Dotenv\Exception\InvalidPathException;
use Doctrine\Performance\EntityManagerFactory;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Migrations\Configuration\Configuration;
use Doctrine\Migrations\Configuration\Migration\PhpFile;
use Doctrine\Migrations\Configuration\Connection\ExistingConnection;
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
$testando = new Doctrine\Migrations\Configuration\Configuration;
try {
$dotenv = Dotenv::createImmutable(realpath(__DIR__. '../../'));
$dotenv->load();
} catch (InvalidPathException $e) {
$teste = $e;
}
$testando->setEntityManagerName('teste');
require __DIR__.'/../../api/vendor/autoload.php';
$config = new PhpFile(__DIR__. '/migrations.php'); // Or use one of the Doctrine\Migrations\Configuration\Configuration\* loaders
$confiEntity = ORMSetup::createAttributeMetadataConfiguration(
[realpath(__DIR__ . '../../Entity')],
true
);
$connDBL = [
'driver' => 'pdo_mysql',
'host' => $_ENV['HOST'],
'dbname' => $_ENV['DBNAME'],
'user' => $_ENV['USER'],
'password' => $_ENV['PASS']
];
$conn = \Doctrine\DBAL\DriverManager::getConnection($connDBL);
$entityManager = new EntityManager($conn, $confiEntity);
return DependencyFactory::fromEntityManager($config, new ExistingEntityManager($entityManager));