Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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.

http://www.doctrine-project.org/docs/orm/2.1/en/reference/tools.html
http://www.doctrine-project.org/projects/migrations/2.0/docs/reference/introduction/en#introduction
{panel}

{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.
{panel}

@doctrinebot

Comment created by @beberlei:

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

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
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.