I would like to change the location of the doctrine cli-config.php file as well as possibly change it's name -- the first request is more important.
Any ideas???
I would like to change the location of the doctrine cli-config.php file as well as possibly change it's name -- the first request is more important.
Any ideas???
Exists another one approach. You can add in custom location file, for example cli.php(with your own file name). Than add in this file something like that:
```
<?php
// cli.php
// where your entityManager is created
require_once "bootstrap.php";
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager)
));
\Doctrine\ORM\Tools\Console\ConsoleRunner::run($helperSet);
```
And you can run this file from where you want like php cli.php
.
If you are using the doctrine CLI directly, this is not possible.
You can see this by having a look at the relevant source code:
It only ever checks for
cli-config.php
andconfig/cli-config.php
.The alternative is to implement a CLI based on the Symfony Console component (which is what the Doctrine CLI is based on) yourself, and pull in the Doctrine commands. This allows you to avoid having
cli-config.php
altogether at the cost of having to put in a not-insignificant amount of work. You can find the details of this approach in this answer.