doctrine CLI doesnt response anything , when it was with option #5537

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

Originally created by @larrydalaw on GitHub (May 17, 2017).

Originally assigned to: @Ocramius on GitHub.

Hello dudes,

thanks in advanced...

if i typed, at vendor/bin, ./doctrine or php doctrine , it shows something about complaining i did not have the config file at the folder.

but if i typed, php vendor/bin/doctrine orm:convert-mapping xml entities --from-database --force
and
php vendor/bin/doctrine orm:generate-entities entities

it shows nothing ...

i was actually following this guide to do the reverse engineering
http://blog.erikdev.com/post/35750855756/doctrine-setup-tutorial

my bootstrap.php

<?php
require_once "vendor/autoload.php";
// Load EntityManager
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
// Set Entity Manager parameters
$paths = array("entities");
$isDevMode = false;
$dbParams = array(
  'driver'   =&gt; 'pdo_mysql',
  'user'     =&gt; 'root',
  'password' =&gt; 'xxxxxx',
  'dbname'   =&gt; 'shophpmigrate',
);

$config = Setup::createXMLMetadataConfiguration($paths, $isDevMode);
$em     = EntityManager::create($dbParams, $config);

my cli_config.php

<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;

// replace with file to your own project bootstrap
require_once 'bootstrap.php';


$em = GetMyEntityManager();

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getCo$
    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));

i believe i have filled in proper info in database.php and .env

Originally created by @larrydalaw on GitHub (May 17, 2017). Originally assigned to: @Ocramius on GitHub. Hello dudes, thanks in advanced... if i typed, at vendor/bin, ./doctrine or php doctrine , it shows something about complaining i did not have the config file at the folder. but if i typed, `php vendor/bin/doctrine orm:convert-mapping xml entities --from-database --force` and `php vendor/bin/doctrine orm:generate-entities entities` it shows nothing ... i was actually following this guide to do the reverse engineering http://blog.erikdev.com/post/35750855756/doctrine-setup-tutorial my bootstrap.php ``` <?php require_once "vendor/autoload.php"; // Load EntityManager use Doctrine\ORM\Tools\Setup; use Doctrine\ORM\EntityManager; // Set Entity Manager parameters $paths = array("entities"); $isDevMode = false; $dbParams = array( 'driver' =&gt; 'pdo_mysql', 'user' =&gt; 'root', 'password' =&gt; 'xxxxxx', 'dbname' =&gt; 'shophpmigrate', ); $config = Setup::createXMLMetadataConfiguration($paths, $isDevMode); $em = EntityManager::create($dbParams, $config); ``` my cli_config.php ``` <?php use Doctrine\ORM\Tools\Console\ConsoleRunner; // replace with file to your own project bootstrap require_once 'bootstrap.php'; $em = GetMyEntityManager(); $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array( 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getCo$ 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) )); ``` i believe i have filled in proper info in database.php and .env
admin added the Invalid label 2026-01-22 15:10:28 +01:00
admin closed this issue 2026-01-22 15:10:29 +01:00
Author
Owner

@Ocramius commented on GitHub (May 17, 2017):

The file name should be cli-config.php and should be in your CWD (current working directory)

@Ocramius commented on GitHub (May 17, 2017): The file name should be `cli-config.php` and should be in your CWD (current working directory)
Author
Owner

@sensorario commented on GitHub (May 18, 2017):

@larrydalaw is this line correct?

    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getCo$

I mean, ... The "$" is a typo here or a typo also in your cli-config.php file?

($em->getCo$

maybe you have also some trouble in php error handling and the typo is not displayed in your cli.

@sensorario commented on GitHub (May 18, 2017): @larrydalaw is this line correct? 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getCo$ I mean, ... The "$" is a typo here or a typo also in your `cli-config.php` file? ($em->getCo$ maybe you have also some trouble in php error handling and the typo is not displayed in your cli.
Author
Owner

@larrydalaw commented on GitHub (May 25, 2017):

ops, that's just a copy and paste error... the content should be

<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;

// replace with file to your own project bootstrap
require_once 'bootstrap.php';


$em = GetMyEntityManager();

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));


@larrydalaw commented on GitHub (May 25, 2017): ops, that's just a copy and paste error... the content should be ``` <?php use Doctrine\ORM\Tools\Console\ConsoleRunner; // replace with file to your own project bootstrap require_once 'bootstrap.php'; $em = GetMyEntityManager(); $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array( 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) )); ```
Author
Owner

@larrydalaw commented on GitHub (May 25, 2017):

cli-config.php is in the same directory of artisan and app etc

@larrydalaw commented on GitHub (May 25, 2017): cli-config.php is in the same directory of artisan and app etc
Author
Owner

@larrydalaw commented on GitHub (May 25, 2017):

i managed to see the error reporting.

[17-May-2017 15:45:51 Europe/Berlin] PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illumin in /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
[25-May-2017 11:08:16 Europe/Berlin] PHP Warning: require(/Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/autoload.php on line 17
[25-May-2017 11:08:16 Europe/Berlin] PHP Fatal error: require(): Failed opening required '/Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php7.1.1/lib/php') in /Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/autoload.php on line 17

@larrydalaw commented on GitHub (May 25, 2017): i managed to see the error reporting. > > [17-May-2017 15:45:51 Europe/Berlin] PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:741 > Stack trace: > #0 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log') > #1 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array) > #2 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array) > #3 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log') > #4 /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illumin in /Users/xxx/Documents/phpproj/scaffold/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741 > [25-May-2017 11:08:16 Europe/Berlin] PHP Warning: require(/Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/autoload.php on line 17 > [25-May-2017 11:08:16 Europe/Berlin] PHP Fatal error: require(): Failed opening required '/Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php7.1.1/lib/php') in /Users/xxx/Documents/Sites/phpproj/laravelio/bootstrap/autoload.php on line 17 > >
Author
Owner

@Ocramius commented on GitHub (May 25, 2017):

Closing as invalid as per comment above. Your script is crashing before even getting to doctrine stuff at all.

@Ocramius commented on GitHub (May 25, 2017): Closing as invalid as per comment above. Your script is crashing before even getting to doctrine stuff at all.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5537