check my amazon wishlist


CoreMedia vs. TYPO3

TIMTAB latest builds

stable:
v0.5.11 from TER
bug fix: commenting was possible although disabled for a post

unstable:
2006-04-15

what's new in unstable:
Ready for TYPO3 4.0.0. Trackback routines reorganized. Now Trackbacks will be sent only when the post is not hidden. Please test wether Trackbacks are working when writing post with tools like w.bloggar.

renner

Coding Night Wannabe an Apple? Robert Sebastian Session Robert

Archives

Categories

Buddies and others

del.icio.us links del.icio.us linkage




    Powered by Technorati



    Disclaimer

    I just brought the site back to life so that people can stop reminding me that it's down. Please note that probably most if not all content is outdated. I'll try to update stuff as soon as possible.

    best Ingo

    20
    Apr
    2007

    Switching from PHPEclipse to PHP IDE (PDT)


    I was using PHPEclipse as my IDE of choice since the days it got enough features to draw me to Eclipse which was also back in my Windows times. As Eclipse is Java based it also runs on Mac OS X and the switch therefor was very easy.

    This week I made another switch, I switched from PHPEclipse to the PHP IDE or PHP Development Tools for Eclipse from Zend and IBM. I had an eye on that Eclipse plugin since it was first announced some when back at the end of 2005. Back then PHPEclipse was still better and PHP IDE was kinda slow and didn't offer to set colors for highlighting which kinda important for me.

    Times have changed though and the guys at Zend and IBM did a great job bringing PDT how it is called now to the point it is now. The features I like most about PDT are that it uses PHPDoc to help you with code completion and hinting and builds an outline of all PHP classes in a project. Also very promissing seems to be the debugging feature which I unfortunately couldn't try out yet as I'm using XDebug but it requires you to install the PHP Zend debugger extension. But there's also another plugin available which makes it possible to use XDebug.


    PDT showing tt_address' plugin extending pi_base

    Switching

    One thing I was worried about before switching to PDT was whether I would have to recreate all my projects which are PHPEclipse projects as PDT projects. That would have taking quite a while. Fortunately I figured out a simpler and faster way then doing that by hand. It still requires you editing some files but you don't need to run through all the project creation wizards at least.

    I'll describe it for Mac OS X and Textmate but it should be very similar on Linux and Windows systems.
    First in Terminal go to the folder which is holding your project's files. With "ls -al" you'll see that there's a file called ".project". Having Textmate's commandline tool installed you can open it in Textmate with "mate .project". You'll see that it describes that it is mentioning PHPEclipse, this is basically all which makes it a PHPEclipse project:

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    <name>EXT:tt_address</name>
    <comment/>
    <projects/>
    <buildSpec>
    <buildCommand>
    <name>net.sourceforge.phpeclipse.parserbuilder</name>
    <arguments/>
    </buildCommand>
    </buildSpec>
    <natures>
    <nature>net.sourceforge.phpeclipse.phpnature</nature>
    </natures>
    </projectDescription>

    Now edit the PHPEclipse parts to match this file, do not copy and paste the whole file though as it also specifies the project's name.

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    <name>EXT:tt_address</name>
    <comment/>
    <projects/>
    <buildSpec>
    <buildCommand>
    <name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
    <arguments/>
    </buildCommand>
    <buildCommand>
    <name>org.eclipse.wst.validation.validationbuilder</name>
    <arguments/>
    </buildCommand>
    </buildSpec>
    <natures>
    <nature>org.eclipse.php.core.PHPNature</nature>
    </natures>
    </projectDescription>

    In addition to the changes on the .project file PDT projects have another file for individual project options created by PDT.

    <?xml version="1.0" encoding="UTF-8"?>
    <phpProjectOptions>
    <projectOption name="org.eclipse.php.core.contextRoot"/>
    <projectOption name="org.eclipse.php.core.defaultEncoding"/>
    <includepath/>
    </phpProjectOptions>

    Create a new file copy and paste the following contents and save it as ".projectOptions" in your project's folder.

    These steps should turn your PHPEclipse project into a PDT project.

    Some remaining hints though: At least on my MacBook Pro Eclipse starts "building the workspace" when opening that migrated project and it can't be cancelled. When having a complete TYPO3 project in a Eclipse project this can take up to half an hour but will reward you with code hinting for every class in TYPO3 in any file you edit. Alternatively you can remove the buildCommand block with the PhpIncrementalProjectBuilder to prevent Eclipse using it and taking up so much time.

    The other thing is that I wasn't able to run PHPEclipse and PDT in parallel. Thus I had to disable and then uninstall PHPEclipse before I could fully work with PDT.

    I think PDT is the way to go and will keep improving and stabilize until the 1.0 release which is scheduled for September. Check it out yourself!

    comments

    #1 | ingo schommer commented on Saturday, 21-04-07 07:41

    Gravatar: ingo schommer

    >> "When having a complete TYPO3 project in a Eclipse project this can take up to half an hour"
    yeah, thats exactly why i don't switch to PHPIDE (while its feature-set is quite tempting). i have to check out projects with lots of files nearly on a daily basis (debugging for clients etc.), and I'm way to impatient to wait more than 30sec for my project to be useable ;) most of the guys at work switched back from PHPIDE to PHPEclipse by now (for this reason only)...


    #2 | Ingo commented on Saturday, 21-04-07 09:59

    Gravatar: Ingo

    Hi Ingo =) hmm yeah, as I said you can prevent that by removing that one buildCommand block, I didn't encounter any problems with that so far


    #3 | Rolf commented on Saturday, 05-05-07 12:02

    Gravatar: Rolf

    hi Ingo, I just made the same move about a month earlier, no regrets. Check out the PDT discussion list or newsgroup for help on running Xdebug (once you have the right versions of the plugins together and have the file paths set up, it's really easy and really useful).

    You might also want to check the SimpleTest website: there's a plugin for Eclipse to run SimpleTest and supposedly also PHPUnit unit tests. I'm still struggling with that one :-) but it could be very useful for local regression testing.


    #4 | Andreas Kostner commented on Tuesday, 31-07-07 11:57

    Gravatar: Andreas Kostner

    Huh, reading this makes me think of my decision to throw away PDT ;).
    It tried it once very short and it had some problems with my installation. There was no PHP Highligting so i deleted it :). But reading this post i think i will give PDT another try ;).


    #5 | Ingo commented on Monday, 03-09-07 13:55

    Gravatar: Ingo

    PDT now even has xdebug support built in since the last milestone and the speed problems when loading a whole TYPO3 installation into a project are gone, too!


    Sorry, comments are closed for this post.