phpeclipse: jump to function definition? - php

From zend's IDE I know that Ctrl+left click on a function name opens the corresponding source file and jumps to the functions definition
Is there anything similar in eclipse especially phpeclipse OR CDT?
I'm not sure if its just a window->preferences setting I don't see OR some kind of source code indexing I may have disabled which also don't find in the settings (if available)
Anyone knows the right settings?
I'm using eclipse 3.4.1 with pdt 2.0.0.v20081229.

Using Juno and PDT (PHP Development Tools) you can add this useful feature to a project in this way:
right click on the project -> Configure -> Add PHP Support.

Ctrl+Left click usually works in Eclipse as well, although it's horribly slow to react. For that reason I usually use F3 after moving the caret to the function name.
The thing with Ctrl+Click can be found in the preferences in "General > Editors > Text Editors > Hyperlinking". It can be turned off, there. But this function apparently required support from the respective editor/parser to be available at all.
The F3 key is bound to "Open Declaration" here. If that's not the case this mapping can be manually added, otherwise it may be that Eclipse is just not able to do that with PHP.

Related

PHP code navigation in Dreamweaver CS 5

I have started to use Dreamweaver CS5 for PHP coding. The PHP syntax highlighting works fine but I don't get code completion and navigation to work.
For instance in other editors if I press the CTRL key while the mouse cursor is over a variable or function then I can jump to its definition with a mouse click.
Another problem is that when I define a class, usually a hint with a list of methods should appear after inserting "myinstance->" which is not the case in Dreamweaver.
Does Dreamweaver support this? If yes, how can I enable this functionality? Does this also work if the class definition is in a separated file which is referenced with "include"?
Regards,
I am using aptana studio based on eclipse but slightly faster than eclipse. It has very nice features such as suggestions, auto-complete, code-formatting, highlighting, showing syntax errors on the fly
Attaching a css file can help.
Open a php file -> right click on the page -> CSS Styles -> Attach Style Sheets..
Select your css file. The Code Navigator will be activated
Dreamweaver is not a good PHP IDE, other than syntax highlighting it offers little in the way of tools to help a programmer.
I'd recommend NetBeans as a good free IDE for PHP development. Eclipse is also free, but I understand that the latest version doesn't really have a working PHP module so you'll have to use the previous to current version.

Using aptana to debug with easyphp +cakephp

I'm starting a new project, for this project, I need a great IDE, which allows me to debug. I thought to aptana after some search.
But this project is a little specific, it has to work with a specific version of php and has not common extension(e.g. php_ingres), so I think I cannot use the internal server of aptana, otherwise it will not find every ingres function.
I've an EasyPhp environnement installed and working.
I've created a new "Simple server" and a new web browser configuration using this webserver(and chrome). But now when I try to debug it, I cannot see my browser configuration, it looks like it display only internal servers here. So is this possible to use aptana with easyphp? If yes, how?
If not, which IDE provide some auto-completion, debugging and allows me to use my own server?
Thank you very much
I think Netbeans can do your job, check this guide :
http://wiki.netbeans.org/HowToConfigureXDebug
Netbeans is great and is free too. But it maybe hard to figure your way around in that for a 1st time user. If money ain't a problem i'd suggest using phpDesigner 7 - http://www.mpsoftware.dk/phpdesigner.php. Easy and simple, with word completion, debugging features and also allows you to setup up an FTP connection to your servers so you can edit your files on the fly.(This method of editing files on the fly however may not be ideal if its mission critical data. I'd suggest using version control platforms like git, read more here - http://progit.org/book/ch1-1.html )
I finally used code lobster, which is not the best editor but can use easyPhp and actually debug into it.

Finding subtitute pluggin (After Switching from Notepad++ to Netbeans 6.8)

i would like to ask about some Notepad++ feature that i couldn't find in netbeans. And this feature is somehow really helpful. It's called 'function list' created by Jens Lorenz.
this feature will list all of declared function in a PHP files. So, is there any subtitute plugin that i can use to smooth my migration from Notepad++ to Netbeans ?
the main reason i switch is for svn, Phpdoc-support, and easiness maintaining medium-size web project.
What version of Netbeans are you using I am currently doing my php development in Netbeans 6.8 and it already has this functionality.
If you are looking for all functions in all files, i'm not sure that netbeans has this.
When I create a php file it displays all of my functions in the class navigator like this:
(source: developer.com)
If you do not see the navigator you can display it by pressing Ctrl+7
Netbeans has this by default, it is called the 'Navigator' CTRL + 7
You may also want to check out Alt F7 which is the Find Usages shortcut, it comes it very handy for finding every place a variable is used or when a function is declared/used

PHP Editor that able to trace dependency of all function in a file with models/controllers or another part of a framework (or something we had code)

hello a friend of mind ask something about php editor for his companion on coding.
PHP Editor that able to trace dependency of all function in a file with models/controllers or another part of a framework (or something we had code).
Basicly we use notepad++ but seeking another alternative.
I used Eclipse PDT, Aptana, Netbeans, and Komodo. For Web development (at least my style: PHP, Python, Perl, HTML, JavaScript, Ruby, CSS, all the goodies) nothing has touched Komodo IDE. There is a free/open source version called Open Komodo that, unfortunately, is not as feature complete as Komodo IDE but still great.
It runs on Windows, Linux, and Mac (which is a plus since I use all three at times), is completely extendible through plugins, has source code repository features, file transfer features (s/ftp, scp, etc) and so much more. What it really wins on is polish (things like multi-language/library code auto complete).
Komodo ide. Able to set up included libraries on the path. Full featured local and remote debugging. As a bonus it runs on Windows / Linux and Mac.
http://www.activestate.com/komodo-ide
I highly recommend NetBeans (netbeans.org). I've had great luck with it, and using the "Included Files" portion, you can include files outside the website source, so it's able to analyze back through something like CakePHP. The latest release includes support for Symfony too.
I can recommend Eclipse and Aptana Studio 1.5 (which is much better than the PDT plugin for Eclipse). I use it daily for some very large PHP projects on Windows PCs and Macs.
Take a look at nWire for PHP. It is an Eclipse PDT plugin which provides real-time code analysis and exploration. You can easily browse and even visualize all kinds of dependencies within your code.

Can you enable variable highlighting with Eclipse PDT?

I'm using version 3.3.2, I know that regular Eclipse for Java does variable highlighting.
Notepad++ does it regardless of what language you're using (if you select any text, it highlights similar text)
I know it's not critically important, and a back/forward incremental search is an adequate workaround, but it would be nice to have.
Update Looks like I had PDT 1.03, (current version is 2.0), I have Eclipse 3.2.2. Needed to look in "Help -> Software Updates -> Manage Configuration", not just "Help -> About".
You can download new PDT 2.0 All-in-one together with Eclipse 3.4 - this feature as "mark occurences" is here an there is some new features. I use it now and found it stable.
http://www.eclipse.org/pdt/downloads/
I believe 'mark occurrences' is the option which is the closest of what you call 'syntax highlighting'
But PHP Development Tools (PDT) had not that feature in 2007, according to this discussion.
However this bug says PDT1.1 has now the ability to mark occurrences.
Full description in this pdf document.
I think your question in poorly worded. Syntax highlighting, and highlighting all similar strings are very different.
Not sure about PDT but I would suggest to try PHPEclipse plugin instead, which is much more powerful. It gives you pretty much everything that Eclipse provides for java - marking occurrences, Ctrl-click navigation, code completion, etc.
Another trick is to highlight the word then right click -> refactor -> rename OR just Alt-Shift-R
This highlights all occurrences of the variable.
Esc key to stop highlighting.
Just be sure you don't accidentally rename it (easy enough to undo if you do).

Categories