Skip to content

DDC-1330: Doctrine CLI and additional things like Migrations #1946

doctrinebot opened this Issue Aug 14, 2011 · 2 comments

2 participants


Jira issue originally created by user felicitus:

I'm currently trying out Migrations. However, it seems to me that it is not possible to easily add migrations to a system-wide installed Doctrine2 ORM.

This bug is probably 50% documentation issue and 50% code issue.

What I'm basically trying to do is to add the migrations project.

{panel:title=Problem One: The $cli object}
The documentation for both migrations and ORM state about the $cli object. However, it is never explained how the $cli object is instanciated.

It isn't obvious that $cli is either defined by the doctrine command (=doctrine.php which comes with the sandbox and is eventually installed system-wide) or actually needs to be defined by the developer himself. It might be obvious when you read the complete manual first (like a book, which actually nobody does - at least not anybody I know), but this isn't helpful because the manuals are all reference manuals.

So the manuals need to be changed so that it actually explains where $cli comes from.

{panel:title=Problem Two: Defining a custom doctrine.php file}
As there's no code - at least not which I could have found easily - to add CLI commands to system's doctrine.php without modifying it, developers are forced to duplicate the code of doctrine.php and add their own CLI commands.

The problem could be easily avoided by allowing the users to define something like $additionalCommands in their cli-config.php which could then appended via $cli->addCommands() in the master doctrine.php file.


Comment created by @beberlei:

Added a part on setiing up the CLi into the ORM docs.


Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.2 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.