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

Closed
opened 2026-01-22 13:21:36 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 14, 2011).

Originally assigned to: @beberlei on GitHub.

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}

Originally created by @doctrinebot on GitHub (Aug 14, 2011). Originally assigned to: @beberlei on GitHub. 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}
admin added the Bug label 2026-01-22 13:21:36 +01:00
admin closed this issue 2026-01-22 13:21:37 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 17, 2011):

Comment created by @beberlei:

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

@doctrinebot commented on GitHub (Dec 17, 2011): Comment created by @beberlei: Added a part on setiing up the CLi into the ORM docs.
Author
Owner

@doctrinebot commented on GitHub (Dec 17, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 17, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1665