[PR #1081] [CLOSED] Add "additional commands" to the Console Runner #9130

Closed
opened 2026-01-22 16:03:20 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/1081
Author: @kander-zz
Created: 7/15/2014
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • ccf88d0 Add "additional commands" to the Console Runner

📊 Changes

1 file changed (+18 additions, -0 deletions)

View changed files

📝 lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php (+18 -0)

📄 Description

Currently, using Migrations in a Doctrine projects requires you to roll your own CLI. We already have a cli-config.php which is called when running /vendor/bin/doctrine.php - however, that only allows us to inject a HelperSet. It does not offer a mechanism to inject additional commands into the CLI application.

If this patch is accepted, I'll submit a suggestion for Migrations' documentation to call:

ConsoleRunner::addAdditionalCommand(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand);
ConsoleRunner::addAdditionalCommand(new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand);
... etc

I'm not 100% whether line 73 should be in ConsoleRunner::addCommands() or ConsoleRunner::run() - I've placed it in run() for now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/1081 **Author:** [@kander-zz](https://github.com/kander-zz) **Created:** 7/15/2014 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`ccf88d0`](https://github.com/doctrine/orm/commit/ccf88d0e760898c783676e900c567ed64f50c5ca) Add "additional commands" to the Console Runner ### 📊 Changes **1 file changed** (+18 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php` (+18 -0) </details> ### 📄 Description Currently, using Migrations in a Doctrine projects requires you to roll your own CLI. We already have a cli-config.php which is called when running /vendor/bin/doctrine.php - however, that only allows us to inject a HelperSet. It does not offer a mechanism to inject additional commands into the CLI application. If this patch is accepted, I'll submit a suggestion for Migrations' documentation to call: ConsoleRunner::addAdditionalCommand(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand); ConsoleRunner::addAdditionalCommand(new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand); ... etc I'm not 100% whether line 73 should be in ConsoleRunner::addCommands() or ConsoleRunner::run() - I've placed it in run() for now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:03:20 +01:00
admin closed this issue 2026-01-22 16:03:20 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9130