views:

24

answers:

2

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

+1  A: 

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\tools' to 'application\config' 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 "application\libraries\Doctrine\Common" and looking for "ClassLoader.php"

Does that help?

Dash
Hi, and thanks for your answer. I think my setup was OK all along. After a while I realised it must have been a problem with something else, not doctrine or my setup. I had downloaded the packages myself so I pulled the whole package and sandbox using git and had the same problem there so I knew it was someething else. In regards to the paths, I think the chdir line in my doctrine.php was telling the file to act as if it was in application/libraries instead of just application, so all the paths were correct. Will post what I was doing wrong in answer below.
slugmandrew
A: 

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.

slugmandrew