diff --git a/UPGRADE.md b/UPGRADE.md index 10bd5ba1cf1..78238bbf115 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,13 @@ awareness about deprecated code. # Upgrade to 3.3 +## Deprecated the `doctrine-dbal` binary. + +The documentation explains how the console tools can be bootstrapped for standalone usage. + +The method `ConsoleRunner::printCliConfigTemplate()` is deprecated because it was only useful in the context of the +`doctrine-dbal` binary. + ## Deprecated the `Graphviz` visitor. This class is not part of the database abstraction provided by the library and will be removed in DBAL 4. diff --git a/bin/doctrine-dbal.php b/bin/doctrine-dbal.php index 2f83e0d144f..f8dca229641 100644 --- a/bin/doctrine-dbal.php +++ b/bin/doctrine-dbal.php @@ -2,6 +2,15 @@ use Doctrine\DBAL\Tools\Console\ConsoleRunner; +fwrite( + STDERR, + '[Warning] The use of this script is discouraged.' + . ' You find instructions on how to boostrap the console runner in our documentation.' + . PHP_EOL +); + +echo PHP_EOL.PHP_EOL; + $files = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php']; $loader = null; $cwd = getcwd(); diff --git a/docs/en/reference/cli-tools.rst b/docs/en/reference/cli-tools.rst new file mode 100644 index 00000000000..023dc70dea4 --- /dev/null +++ b/docs/en/reference/cli-tools.rst @@ -0,0 +1,37 @@ +CLI Tools +========= + +Doctrine DBAL bundles commands that can be integrated into a Symfony console application. + +When you use DBAL inside a full-stack Symfony application, DoctrineBundle already integrates those into your +application's console. + +There is also a standalone console runner available. To use it, make sure that Symfony console is installed:: + + composer require symfony/console + +With a small PHP script, you can bootstrap the console tools: + +.. code-block:: php + + #!/usr/bin/env php +