I am completely new to doctrine ORM and my objective is to get the schema from an open source project on a git repository below:
https://github.com/monarc-project/zm-core
I am trying to set up the doctrine CLI for this application to probe the database and generate schema but after installing the dependencies and running doctrine I get the following error:
$php vendor/bin/doctrine
You are missing a "cli-config.php" or "config/cli-config.php" file in your
project, which is required to get the Doctrine Console working. You can use the
following sample as a template:
<?php
use DoctrineORMToolsConsoleConsoleRunner;
// replace with file to your own project bootstrap
require_once 'bootstrap.php';
// replace with mechanism to retrieve EntityManager in your app
$entityManager = GetEntityManager();
return ConsoleRunner::createHelperSet($entityManager);
From error message it seems there are two paths I can take:
-
I should not be using doctrine and instead use bin/console. However for console to work I need to upgrade to php 8.1 which doesn’t meet this projects requirements. Thus is not an alternative.
-
If I still try to use doctrine I cannot see cli-config.php which I am presuming should have been there before. I tried to create one but then don’t know which bootstrap.php should be used by cli-config.php. There are following bootstrap files present in vendor directory.
./vendor/symfony/polyfill-intl-normalizer/bootstrap.php
./vendor/symfony/polyfill-intl-idn/bootstrap.php
./vendor/symfony/polyfill-php81/bootstrap.php
./vendor/symfony/polyfill-ctype/bootstrap.php
./vendor/symfony/polyfill-php73/bootstrap.php
./vendor/symfony/polyfill-php80/bootstrap.php
./vendor/symfony/polyfill-mbstring/bootstrap.php
./vendor/symfony/polyfill-intl-grapheme/bootstrap.php
./vendor/symfony/polyfill-php72/bootstrap.php
./vendor/cakephp/utility/bootstrap.php
After struggling for 2 days I think it is better to get some pointers in case I am completely going on a wrong track.
Thanks a lot for any inputs.