Skip to content

Commit 78484f9

Browse files
authored
Merge pull request #1378 from baktify/3.7.x-actualized-config-cli
Updated documentation for config-cli.php file according to v3.7.x
2 parents e4e0855 + 395a530 commit 78484f9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/en/reference/configuration.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,21 @@ Now update your ``cli-config.php`` in the root of your project to look like the
348348
require 'vendor/autoload.php';
349349
350350
use Doctrine\ORM\EntityManager;
351-
use Doctrine\ORM\Tools\Setup;
351+
use Doctrine\ORM\ORMSetup;
352352
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
353353
use Doctrine\Migrations\DependencyFactory;
354+
use Doctrine\Migrations\Configuration\Migration\PhpFile;
355+
use Doctrine\DBAL\DriverManager;
354356
355357
$config = new PhpFile('migrations.php'); // Or use one of the Doctrine\Migrations\Configuration\Configuration\* loaders
356358
357359
$paths = [__DIR__.'/lib/MyProject/Entities'];
358360
$isDevMode = true;
359361
360-
$ORMconfig = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
361-
$entityManager = EntityManager::create(['driver' => 'pdo_sqlite', 'memory' => true], $ORMconfig);
362+
$ORMConfig = ORMSetup::createAttributeMetadataConfiguration($paths, $isDevMode);
363+
$connection = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'memory' => true]);
364+
365+
$entityManager = new EntityManager($connection, $ORMConfig);
362366
363367
return DependencyFactory::fromEntityManager($config, new ExistingEntityManager($entityManager));
364368

0 commit comments

Comments
 (0)