Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1330

Doctrine CLI and additional things like Migrations

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: Documentation, Tools
    • Security Level: All
    • Labels:
      None

      Description

      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.

      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

      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.

        Activity

        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - Added a part on setiing up the CLi into the ORM docs.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Timo A. Hummel
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: