Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Doctrine cli broken in zf2 beta 3 #16

Closed
fuhrysteve opened this Issue Apr 10, 2012 · 16 comments

Comments

Projects
None yet
3 participants

Not sure if this is a bug for DoctrineModule or DoctrineORMModule, but here's the situation:

Trying to run the cli tool from the command line (with no parameters) yields:

Fatal error: Uncaught exception 'Zend\Di\Exception\MissingPropertyException' with message 'Missing instance/object for parameter drivers for DoctrineORMModule\Doctrine\ORM\DriverChain::__construct' in /proj/vendor/ZendFramework/library/Zend/Di/Di.php:617

DoctrineORMModule\Doctrine\ORM\DriverChain extends DoctrineModule\Doctrine\Common\DriverChain, which has this constructor:

public function __construct(array $drivers = array(), Cache $cache)

Interestingly enough, if you override it with a constructor with no params in DoctrineORMModule\Doctrine\ORM\DriverChain, that seems to at least partially fix it.

Owner

Ocramius commented Apr 10, 2012

That constructor is messed up... I will have to fix that, thank you for reporting!

Owner

Ocramius commented Apr 10, 2012

@fuhrysteve does that happen with a clean application skeleton with just DoctrineModule and DoctrineORMModule?

@ghost ghost assigned Ocramius Apr 10, 2012

Yeah, they only other thing I did was copy the "Application" module in ZendSkeletonApplication (EDIT: wrong link), change the name, and create a couple of entities in there to try out.. so it's pretty bare.

Owner

Ocramius commented Apr 10, 2012

This is quite severe, will fix it asap...

Owner

Ocramius commented Apr 10, 2012

Hey @fuhrysteve, could you please provide a reproducible example of the broken behavior? I couldn't reproduce it. A branch in your ZendSkeletonApplication fork would be perfect to investigate...
The constructor signature is obviously incorrect, but as said, I couldn't reproduce it...

Blah, having a tough time reproducing it once I move stuff around too. I'll try again tomorrow.

Owner

Ocramius commented Apr 11, 2012

Got to reproduce this one, I already found a fix :)

@Ocramius Ocramius added a commit to doctrine/DoctrineModule that referenced this issue Apr 11, 2012

@Ocramius Ocramius Fixing doctrine/DoctrineORMModule#16
Which was caused by the constructor method signature to be wrong and by the class being abstract, thus making the DiC ignore the constructor method itself
59c43f9
Owner

Ocramius commented Apr 11, 2012

Fixed :)

@Ocramius Ocramius closed this Apr 11, 2012

Perfect timing, I was just about to jump in there again. Thanks!

Celtico commented Aug 7, 2012

Hello,
I think I have it set came and put:
. / vendor / bin / doctrine orm-module: convert-mapping /
To see if it's creation in any area code and jump me RuntimeException error Not enough arguments.

versions:
DoctrineModule Version 0.5.0 Command Line Interface
VERSION = '2 .0.0 ZF rc2 ';

All uploaded through git and composer

thanks
TRANSLATION google

Owner

Ocramius commented Aug 7, 2012

@Celtico the command is ./vendor/bin/doctrine-module orm:convert-mapping ...
Also, not sure what you are doing there

Celtico commented Aug 8, 2012

Sorry
My purpose is to generate automatically entities.
(. / vendor / bin / doctrine orm-module: convert-mapping - from-database yaml. / mapping), this command works fine.
(. / vendor / bin / doctrine orm-module: generate-entities - generate-methods = "true". / mapping) and how to indicate this is not where is the yml

Owner

Ocramius commented Aug 8, 2012

@Celtico sorry, I don't speak spanish.
By the way, just don't generate entities, that's just a bad practice introduced by Symfony...

Celtico commented Aug 8, 2012

I updated the commentary in English.
Because could not be generated automatically and then move and modify to your liking

Owner

Ocramius commented Aug 8, 2012

@Celtico as said anyway, the command is ./vendor/bin/doctrine-module. You are not using the module's.

Celtico commented Aug 8, 2012

thank you very much!
It all works perfect
./vendor/bin/doctrine-module orm:convert-mapping --filter="NameTable" --from-database annotation ./module/NameModule/src/NameModule/Entity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment