06 July, 2008

solved: symfoclipse sync doesn't work!

Using eclipse pdt for working on my php projects is quite fun (well, somehow). I became a fan of symfony framework recently and also learned that there is a plug-in for pdt supporting symfony commands and other thingies called symfoclipse which is cool, but when i tried to sync my project using symfoclipse's sync command, it freezed!! Why? Well, rsync connects to production server through ssh, when the production server asks for credentials rsync needs user to input the credentials but it doesn't show up in the eclipse console. So, it stands still waiting for the user input which is never going to happen. So it freezes!

As always googling around finally paid off.

To fix that problem find the following file
pear/data/symfony/tasks/sfPakeEnvironment.php

in your installation.
Almost at the end of the file you find this line:
echo pake_sh($cmd);

change it to:
echo pake_sh('start ' . $cmd);

that will fix the problem (hopefully). The next time you run the sync a command prompt window will appear asking for credentials.
And it shuts as soon as it's done. What?! Hang on a minute. I need that command prompt to stay open afterward, so I can check if everything went well or not!
Well you can change that line to
echo pake_sh('start cmd /k ' . $cmd);

that will keep the command prompt window open just for you :-)