warning The use of this script is discouraged #7013

Closed
opened 2026-01-22 15:43:10 +01:00 by admin · 0 comments
Owner

Originally created by @remco-pc on GitHub (Jul 31, 2022).

Bug Report

[Warning] The use of this script is discouraged. See https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/tools.html#doctrine-console for instructions on bootstrapping the console runner.

Version 2.12.3

Summary

I have used the console runner now and still get this warning.

My code:

<?php
/**
 * @author          Remco van der Velde
 * @since           2022-07-31
 * @version         1.0
 * @license         MIT
 * @changeLog
 *     -    all
 */

use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider;

$dir = __DIR__;
$dir_vendor =
    $dir .
    DIRECTORY_SEPARATOR .
    'vendor' .
    DIRECTORY_SEPARATOR;

$autoload = $dir_vendor . 'autoload.php';
$autoload = require $autoload;
$config = new R3m\Io\Config(
    [
        'dir.vendor' => $dir_vendor
    ]
);
$app = new R3m\Io\App($autoload, $config);
echo R3m\Io\App::run($app);
$options = [];
$commands = [];
$entityManager = \R3m\Io\Module\Database::entityManager($app, $options);

ConsoleRunner::run(
    new SingleManagerProvider($entityManager),
    $commands
);
Originally created by @remco-pc on GitHub (Jul 31, 2022). ### Bug Report [Warning] The use of this script is discouraged. See https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/tools.html#doctrine-console for instructions on bootstrapping the console runner. Version 2.12.3 #### Summary I have used the console runner now and still get this warning. My code: ```php <?php /** * @author Remco van der Velde * @since 2022-07-31 * @version 1.0 * @license MIT * @changeLog * - all */ use Doctrine\ORM\Tools\Console\ConsoleRunner; use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider; $dir = __DIR__; $dir_vendor = $dir . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR; $autoload = $dir_vendor . 'autoload.php'; $autoload = require $autoload; $config = new R3m\Io\Config( [ 'dir.vendor' => $dir_vendor ] ); $app = new R3m\Io\App($autoload, $config); echo R3m\Io\App::run($app); $options = []; $commands = []; $entityManager = \R3m\Io\Module\Database::entityManager($app, $options); ConsoleRunner::run( new SingleManagerProvider($entityManager), $commands ); ```
admin closed this issue 2026-01-22 15:43:11 +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#7013