I'm using Eclipse Galileo for PHP Developers and when I create new, empty project I have 3 folders inside:
JavaScript Resources
PHP Include Path
PHP Language Library
Does Eclipse make copy of PHP for every project? And more important: can I hide it from my project navigator tree?
If you click on the arrow in the Top Right corner of the PHP Explorer and select "Filters" you CAN exclude them from the view. Select "Libraries from external" and "Libraries in project". Unfortunately I haven't been able to figure out how to hide the JavaScript Resources folder.
You are wrong, they are not folders, they are just references, which are defined within the project properties and pdt manages for you. Just look into the folder with your prefered file manager and you will not find folders with this names. So no, eclipse doesnt copy php.
And no, you cant hide them from the php navigator view. There is no obvious reason to hide them anyway.
Related
I have an unusual request,
I'm working on PHP 5.3, my IDE is Eclipse and I need help setting a file like the one that comes in default with the php functions, so I can use it for code completion and I can have the documentation on hover.
So basically, I have a library, which I want to pull the declarations for everything (function, classes, etc) and the PHPDoc block, and use them to create a new file, which will be added as a library on Eclipse on the include path. Anyone knows an automatic way to do it?
EDIT: To explain a bit better what I want to do. I want to run a script that will do almost what PHPDoc does, but instead of creating a set of html files after load a file, it will create a copy of the php file which only has the declarations and comments. So that file can be given to the programmers, instead of the full library with source-code.
I though about using the ReflecationClass, by including each file, check the defined class\functions and then writing the new file, but that means that all the includes\requires need to happen in order, something I can't guarantee
Not sure if this counts as "automatic", but what you describe sounds like it can be roughly accomplished by having this library itself as an open Eclipse project. If your "new code" is in a separate Eclipse project, then you want to list your library project in the new project's Include Path configuration.
In the "PHP Include Path" config popup for your new project, click "Add" and select the library project (it will only be visible here if it is also "open"). You can choose whether or not it should come before the new project on the include path or not by moving things around in the Order tab. I tend to keep my current project listed first, then dependencies afterward, just in case any of my new project's classes take precedence over same name classes in the dependency projects.
An added benefit to this is that when you open your new project, any referenced projects in the Include Path configuration will automatically be opened too.
All,
I'm a beginner user of Eclipse. I am currently using it for a PHP project. I am starting to have a lot of PHP files under my project so I created a folder inside the project to relocate some of the files. However this breaks the program because as I move the files the functions calling for those files are not updated to reflect their new location.
Is there a way to do that automatically in Eclipse? I would have thought that it would be a core functionality (but then again, I've never used an IDE before.)
Thanks,
JDelage
No, you can't do that without refactoring the code. A global find/replace could fix the problem for you though.
You can try to delete your .metadata directory.
(after backup)
/YourProjectDirectory/.metadata
And restart your IDE.
Or eventualy try to run eclipse with the param "-clean"
"C:\ecplipse.exe -clean" (from CMD)
I use ecplise for my php projects.
I want to have an external location for all my plugins and link specific plugins to each of my projects.
I found how to link folders etc, but the actual files aren't copied in the folder, resulting in errors in the website because the files are missing. They are only inside my project.
How can I link an actual folder to my eclipse project, that is being updated automatically from the source?
In Visual Studio there is an option to copy specific resources to the output folder. I am looking for something similar here.
Some things come to mind:
I don't know if such an option exists. You could achieve that with build tools, that just to the copy on build. You wouldn't then need to reference the files in eclipse any longer then however.
You can configure the PHP include path in your project. Then you can configure the include in your application the same. Might not solve all your issues, but would work cross compatible.
I am trying out Aptana for general PHP development, i loaded an old CakePhp project to test the autocomplete and all i can get are the local functions and variable and absolutely none of the inherited ones, which kinda ruins the whole thing. Is there a setting i dont know about that fixes this?
apparently i needed to set up a "Nature" to PHP, the default was some eclipse.something version. Aptana reindexed the file and it works now.
The original poster was correct in adding PHP to the "Nature" of the project, however he did not provide how to do it. I also had the same problem and once I added PHP to the "Nature" selection list the autocomplete provided the options for inherited classess as well.
To add the PHP Nature:
Right click on your project in the Project Explorer View
Click on Properties
In the "Properties for project" window, select Project Natures in the left list box
In the Project Natures window, place a tick next to PHP
Click on OK button
that should get you the autocomplete list.
AJ
I haven't used aptana for PHP, but since it's based on Eclipse I assume the cake folder (in the same level as your app folder usually) needs to be added to your project path.
You can go into the properties of your project and either add it to the path or add it to the libraries.
I usually setup my project to point to the whole folder so I don't need need to do this step, but my Eclipse installation will pick up the inherited methods just fine.
After having installed the HTTP extension from PECL, I expected Zend Studio 6 to recognize the provided HTTP* classes and for code completion to be made available. This is not the case, however. How do I get Zend Studio to recognize classes provided by PHP extensions? Specifcally, I want to be able to use code competition on these classes.
I used the phpgenerator.php script from Michael Spector. It generates a php documentation folder with the loaded extensions on your pc. Afterwards the doc path can be added to the Eclipse (Zend Studio) include path. Code Completion works like a charm.
usage:
console: php phpgenerator.php $path_to_doc_output
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.pdt/plugins/org.eclipse.php.core/Resources/language/?root=Tools_Project
This script can be used for generating PHP model for PDT.
It builds PHP functions according to the loaded extensions in running PHP,
using complementary information gathered from PHP.net documentation
*
#author Michael Spector
In Eclipse, with which Zend Studio shares code, so it might help, is the "PHP Include Path".
"PHP Include Path" is in the project explorer.
There you can add the directory where the extensions are. Then Eclipse will scan it and you will be able to code-complete.
I did the same with PhpUnit2.
I'm not familiar with Eclipse, but if it works in the same way as Netbeans handles PHP extensions, you'll need to add the relevant stub PHP files to the IDE's search path.
You can add functions to Studio by putting PHP files with stub function descriptions into special directory. Find this directory in filesystem in a following way: write something like gmdate(), select the name and press F3. You will be taken to one of the prototype files. Note the directory where this file resides (shown on the top and if you hover over the tab). Now you need to create stubs for functions you are missing just like the one you're looking at. You can put them into any file, generally, but I suggest putting them into separate file - like geoip.php - and put this file into that directory. You may also want to do right-click/Show In/PHP Explorer and browse other prototype files if you need examples of how to do it right.
Zend ship language support for all the extensions in Zend Studio.
The most efficient way of adding support for language entities provided by unsupported extensions is definitely creating stubs (You can add this support yourself). The description "stub" files for all supported PHP entities can be found in this directory:
/.metadata/.plugins/org.eclipse.php.core/language
(this is also the location where you should put your stub files).