Running a Zend Framework based Project on Eclipse - php

Currently I try to get PHP and Zend working on Eclipse. I'm not sure if there is a plugin for Zend or something that makes it comfortable to use in Eclipse, like automatically initializing default MVC-pattern like directory structure, and so on...
I was googling for it and found some tools... First I tried to download and install the PDT from Zend (http://www.zend.com/en/company/community/pdt/), which I did, but if I create a new PHP Project, there is no option to make a "new Zend project" or something like this, so I kept on searching, and found this:
https://code.google.com/p/zend-sdk/wiki/GettingStartedTutorialInEclipse
which absolutely had no visible effect on the GUI of Eclipse. I don't know if it even worked, but it doesn't look like on the screenshots at all. On the screenshots of this projects you can see that there is a option while creating a new PHP project called "Zend Framework default project structure". Below I attached a screenshot of my "new PHP project" dialog.
So, my question is... Did I do something wrong? Or is there currently no proper Zend integration in Eclipse?
Also I want you to know that I need Eclipse for many other programming languages, so I don't really want to have a IDE for each language and it would be nice to get it to work on Eclipse somehow...
I am using Eclipse Juno... If I forgot to provide further information please let me know so I can hand them in later.
I appreciate every kind of help... Thanks in advance

Related

How to configure Eclipse Project for Joomla Component Development

I like to develop a fresh Joomla Component for Joomla 3.x in Eclipse and created therefore a simple PHP project.
The problem I have is now how to setup the correct "include path", so that the basic Joomla PHP classes get found like "JFactory" , "JAccess", "JObject" ...
If I just include a Joomla installation in my include path, this will not work. I assume the paths to the classes are more sophisticated than that.
Any Idea or suggestion how the "include path" for my project should look like?
regards
Mark
It depends a little on what you mean by "found".
If you mean "as I start typing a basic class name every matching basic class gets offered as an option", yes, there is a way to do that.
See the conversation, and solution, on this gitHub page.
I have the stub file referred to and it works in the way I've said above, tho' I'm using NetBeans not Eclipse (but the reference to phpStorm makes me think it should/could work for you too), although I haven't been able to run the build script. I just haven't got the time to single step through it to find out where it stops.

Aptana Studio 3 code completion / assist not working for Yii Framework

I just started development with Aptana Studio 3 and Yiiframework. Since Aptana Studio 3 already supports code completion for PHP and Yiiframework does faciliate correct use of PHPDoc comments and return types, I assumed that calling
$app = Yii::app();
$app->...
should pop up content assist with methods and fields of the CApplication class. But I only see an empty popup window containing 'No proposal'. The same happens when accessing the application object directly using
Yii::app()-> // empty code assist window
When I declare the type of the $app variable explicitly, code assist pops up correct:
/**
* #var CApplication
*/
$app = Yii::app();
$app-> // code assist pops up with correct content
I don't have included yiilite.php - this file is stripped from my framework directory. Code assist works, but not as expected.
Is this a bug, or a missing feature? Can anybody else confirm this behaviour of Aptana Studio 3? Is there any workaround?
Thanks,
David
It is also important to explicitly set the 'Project Nature' to (include) PHP. Project->properties->Project Natures
Follow the steps given here and the code completion should work properly.
The other methods mentioned here will not work for YII code assist.
See if this helps:
Start with a PHP Project (Or for an existing project: Configure -> Add PHP support )
Add the YII framework to the build path like below.
PHP Include path -> Libraries -> Add External source folder -> Select the 'framework' folder from the YII framework unzipped
Also point #5 from Arek about adding the Eclipse PHP nature helped me too. Thanks
I don't know how exactly I did this, but:
Delete already existing project.
Install PDT plugin for
Aptana by "Help->Install New Software"
Restart Aptana Studio
Create again new project and check out in project properties You have new "Nature" called
"org.eclipse.php.core.PHPNature" as a primary.
Uncheck "PHP"
Nature, only "org.eclipse..." should be checked.
Only with this nature I see all classes, methods etc...
With orginial aptana's "PHP" Nature it was impossible.
"org.eclipse.php.core.PHPNature" is solution for this.
EDIT: PDT might not be required for Aptana since it has PHP support built-in
http://firas-vision.com/aptana-yii-2/
please check this solution worked for me , no new plugin , it is just a code fix for com.aptana.editor.php.jar plugin
I pulled a request to change on Aptana git , hope they will include this fix in the next release
http://www.yiiframework.com/forum/index.php/topic/45905-aptana-yii-support-autocomplete/ this seems to have helped with the solution.
unzip your yii source tarbal, import the framework directory as a project on your workspace
Navigate to Your project Explorer, and right click on the project you wish to support Yii's autocomplete on and select "Properties"
A project properties' dialog page will be displayed, on the right side of the dialog there is a tree select the child labelled "PHP Buildpath", on your right click on "Add" and add the "Framework Directory " as part of your build path
Apply Changes and Press OK to submit the changes. Now try to create a class that extends any of the Yii Core Classes it should autocomplete successfully.
Enjoy Yourself

Dreamviewer & Zend Framework project: Wrong path mapping

I tried all the day to set up a Zend Framework project in Dreamweaver CS5.5. Now, after a few hours spending on google and the CS5.5 doc, i am still not able to debug a Zend Framework project in Dreamweaver:
Let's say, i have a module called "admin" in /application/modules/admin. If i try the Live View feature, Live Code, or the dynamic files discover, it fails at all.
If I try to debug the IndexController of the AdminModule, Dreamweaver always tries to render the page http://foo.bar/application/modules/admin/controllers/IndexController.php, insteadof http://foo.bar/admin[/index/index]
Is there any way to get those features working with Dreamweaver CS5.5?
Also, the include path does not work. The /public/index.php includes something like require_once 'Zend/Application.php';. Where does Dreamweaver search? He tells me that he can not find the file http://foo.bar/Zend/Application.php. Omg, srsly?
I hope there are some Dreamweaver PHP developers out there which can help me.
Btw, I am using Zend Studio at the moment and wanted to get a "quick" look into the new CS5.5 features :/
Update 16.05.2012
Little update from me. I'm currently Using PHPStorm from JetBrains. It is the best IDE I ever had. (Ecpilse/Aptana/Zend Studio/PHPDesigner). Autocomplete for nearly everything, huge plugin repository and much nice features like LESS Support, NodeJS Support, PHPUnit integration or an integrated Git Client. Give it a try. It's free for open source projects.
Dreamweaver can technically work with anything, but it's really designed to work with procedural php.
I would recommend the eclipse software with the pdt plugin or net beans. WAY better for supporting a zend framework project imo.
I'm not bagging on dreamweaver, it's a nice tool (especially for html/css), but for OO PHP programming, it's really not designed for it.

YII Pluggin for Net Beans

Can you please let me know where do I get YII Framework plugin for Netbeans? I tried to search but I couldn't find.
Thank you very much!
The question is why do you need a plugin?
Just include Yii framework path in your project include path and all your functions will be part of autocomplete.
I use Yii with netbeans all the time and never felt the need for one. However there is another IDE, codelobster, who recently launched a plugin for yii, you might check it out but it is not as good as netbeans for advanced users, however good enough for basic usage so you might be interested.
Also for PDT there is plugin adding yii framework support. At the moment functionality is limited to creating new yii-powered project and some useful navigation (controller/action -> view, view -> view (partial render), widget->widgetClass, and some others.
More information you can find at yiiclipse home page.
There isn't one currently. That's why you couldn't find it.
actually it is available here is the link
http://www.yiiframework.com/news/69/yii-plugin-for-netbeans/

CodeIgniter with Eclipse PDT, is clean integration possible?

I am attempting to setup codeigniter with eclipse but am getting project errors. From what I understand this should be as simple as creating a new project in eclipse and pointing to the root directory of codeigniter. This properly loads up the codeigniter files but eclipse reports several errors. Looking into the files, it seems like the errors are coming from html files and/or files that print html. For instance, footer.php is showing up as having an error because there is a closing tag but no opening tag. Any suggestions on how to overcome this? At this point would code completion / debugging be too much to ask for as well?
UPDATE: so from what I am gathering from the response below (and searching around on the web) is that when using codeigniter with eclipse one can only take advantage of the code completion / editing features? I also noticed that I am getting NoClassDefFoundError when attempting to open some of the .php files in the eclipse project tree for editing. Surely I must be missing something and there is a way to achieve tighter integration with codeigniter and eclipse? (i would strongly prefer to stick with eclipse as opposed to switching ides) Or maybe this is an issue with my eclipse/pdt setup?
UPDATE 2: I just downloaded the latest eclipse version (galileo) and it seemed to fix all of these issues! except for debugging of course ...
you can achieve tighter integration by initializing the Ci core classes in CI_Base constructor which will also allow you to get auto complete for core classes check out these links:
http://www.gostomski.co.uk/codeigniter/getting-full-auto-complete-with-codeigniter-in-eclipse
http://hetal.wordpress.com/2009/09/04/working-with-eclipse-and-code-igniter/
you will get lots of html errors because the html has been broken into chunks
and is not a complete document
just ignore them thats what i do (there are settings somewhere that control what errors are validated against in eclipse)
i still use the php/html/js code completion and it works fine even with the errors
if you are using svn version control, add subclipse plugin, so you can do that from within eclipse too
Try Aptana.
The last time I checked I was able to do a step by step debug on it and did not see any errors in my project. It is also built on eclipse, so there is nothing new to learn.
For what it's worth, I have been able to get debugging to work using XDebug and the Netbeans IDE. If you cannot get debugging to work in Eclipse you might give Netbeans a try - if for no other reason, to have the ability to debug should you ever need to step through your application's code...

Categories