English 中文(简体)
Why don t any functions run from the Doctrine 2.0 Command Line Interface (CLI)?
原标题:

I ve recently managed to get the betas of Codeigniter 2.0 and Doctrine 2.0 working together, thanks to the help from this guide: http://eryr.wordpress.com/2010/09/26/integrating-doctrine-2-with-codeigniter-2/

I have set up the CLI as set out in that guide, but I can t run any commands - I type doctrine and get the menu and list of commands, but then when I type a command like doctrine orm:schema-tool:create it just loads the same screen again with the list of commands. I don t get any error messages or anything.

My application/doctrine.php: http://pastebin.com/P0CtefhF

My application/cli-config.php: http://pastebin.com/KCVfZFct

If anyone can even give me a clue or point me in the right direction I would be most grateful. I have been trying to get my head around this for a day and a half now :S

最佳回答

Anyone having this trouble should try two things:

  • First of all instead of just typing doctrine command make sure you type php doctrine.php command.

  • Also make sure you have adjusted your system path correctly instead of your user account path.

Once I did both of those things it worked for me fine. Bit confusing though as the first command does work to bring up the list of possibilities, but not when you run any actual command.

问题回答

Hey, I just got this all working together myself.

One thing, it depends on how you DL d doctrine to begin with. I DL d directly, no SVN or GIT in other words.

I ended putting my cli-config.php, doctrine.php and Doctrine.php in "application/tools" dir. "tools" is a dir I just created. It did not exist before.

The current way it s set up with the examples from that link you gave, I think they all need to be in "application/libraries", so if you want to move them to "application/tools" you need to update those paths.

So for example:

require_once CURPATH. /../config/database.php ;

This is saying to go up from application ools to applicationconfig and get that database.php file.

require_once CURPATH. /../libraries/Doctrine/Common/ClassLoader.php ;

And This is doing the same, except that it is going into "applicationlibrariesDoctrineCommon" and looking for "ClassLoader.php"

Does that help?





相关问题
Zend and static class properties

I m trying to assign a value to a static class property when defining it: namespace Base; abstract class Skeleton { protected static $entityManager = end_Registry::get("EntityManager"); ......

require_once missing doctrine zend framework

I m integrating doctrine with Zend Framework. I ve hit an error thrown from cli. It seems Zend_Application_Bootstrap_Bootstrap does not have a require_once for ...

doctrine: QueryBuilder vs createQuery?

In Doctrine you can create DQL in 2 ways: EntityManager::createQuery: $query = $em->createQuery( SELECT u FROM MyProjectModelUser u WHERE u.id = ?1 ); QueryBuilder: $qb->add( select , u ) ...

热门标签