Mongo autocomplete in Zend Studio - autocomplete

Does anyone know how to get auto complete for MongoDB to work in Zend Studio 8. What would actually be an ideal solution is how to add autocomplete for any binary library not in the form of php files.
I.E. I know how to add a folder of php classes to the include path to get autocompletion, but mongo is a php plugin and not a collection of class files. Possible there is a way to generate php files for Zend to use.
Any help would be appreciated.

At first you go here to see that there's a guy who has written a "reflector" of php classes which dumps the contents of a class to a file with phpdoc comments. Also there's a link to sources where mongo.php is present as an example.
You can put that mongo.php into a folder and then in Zend Studio right-click a project, select "properties", go into "php include path -> libraries", click "add external source folder" and point to the folder with the mongo.php.
Voila, zend studio has autocompleting enabled now for MongoDB classes!
Don't know whether that mongo.php is up to date, but I'm using it without a problem.
I've put its code here just for a case.
Probably a bit late answer, but it would be better than nothing ;)

Related

Make Visual Studio Code recognize the classes in the Zend Framework Library

When I open the IndexController with Visual Studio Code it doesn't find any of the classes in the Zend Framework Library which are located in the library/Zend folder.
Whenever I click on Zend_Controller_Action and press CTRL and SPACE, I expect VSC to show me the suggestions, but it doesn't.
class IndexController extends Zend_Controller_Action {[...]}
Intelliphense or whatever that plugin is called is installed already.
It's working in netbeans though, whilst also failing in Zend Studio...PhpStorm...
So I guess there must be some setting, right?
For what it's worth, I just had the same problem, on a system that uses a fairly old version of Zend, using a VS Code with the Inteliphense extension installed, and someone helped me solve it like so:
in VS Code, open Settings
search for "Intelephense Environment include paths"
press "Add Item" to add the following two paths :
/usr/share/php7.2-common/ZendFramework-1.12.20/library/
/usr/share/php7.2-common/

Eclipse PHP formatter for CakePHP

In Eclipse
In Window->Preferences->PHP->Code Style->Formatter
I want to import for CakePHP instead of PHP but I haven't find in the file in format XML.
I appreciate you in advanced.
It should be a xml file like this:
Please refer to this: https://book.cakephp.org/3.0/en/contributing/cakephp-coding-conventions.html
CakePHP encourages you to code using PSR-2, and it should be already included in Eclipse. Additionally, CakePHP ships with .editorconfig file, which, depending on your IDE setup, can be included and can help you.
Go to editorconfig_plugin_Eclipse to look for the Eclipse plugin.
Go to editorconfig_demo for a brief demo slideshow which you could find informative.
Go to editorconfig_example for an example CakePHP editorconfig file on GitHub.
Go to editorconfig_tutorial for a video tutorial (in 3 parts) on the editorconfig file which you could also find helpful.
That all being said, I think the Eclipse community is still waiting for a CakePHP formatting file that meets your needs, one that can just be dropped into the Eclipse environment.

Get Netbeans to Auto-suggest Zend Framework components

I've recently installed ZF, and haven't had any issues using it, however when I'm working in Netbeans, I'd like for it to recognize and suggest ZF components. For example, when I type:
$config = new Zend_
I want it to auto-complete or suggest:
Zend_Registry
Or when I try to use:
Zend_Registry::getInstance();
I'd like for Netbeans to auto-suggest getInstance and recognize documentation for it. I figure it has something to do with including the library inside the application, but I'm not sure where exactly to set this? I have the library set for include_path inside php.ini, and the components work as expected in the browser, so no issues there.
In Netbeans menu go Tools > Options > PHP under General tab Global Include Path section click Add Folder. Add Zend folder from your library, confirm everything. Let Netbeans finish scanning and you're done.

Eclipse/Zend Studio, stop validation for parts of a project tree

I have some external libraries that are showing 'warnings', I want to stop validation of this part of my project because it is interfering with actual warning messages from my source code. Is this possible?
I am using Zend Studio but it is based on eclipse so I think the same method will apply on both applications.
You can try to go to Preferences/Validation/HTML syntax validator for PHP files/ click on settings. Add first an exclude group and then add a rule with your library folder. This will work at least with pure PHP warnings. I have a similar question concerning DLTK warnings and also posted this question to ZS forums, but I have not too much hope from there.
I was having the same issue with a dependency we were pulling in and the previous answer didn't help (maybe because it changed in the last 7 years). I found a solution on the Zend Forums.
Word of caution: if your files are having errors, you probably should NOT preform these steps!
To summarize:
Right-click on the folder.
Click "User As Library Folder"

Problem creating a new framework project in Zend Studio

I have a problem when creating a New Framework project in Zend Studio. I'm new to Zend Studio, using Zend Studio ver.7.1.0.
When creating a new Zend framework project (Zend Server is successfully installed), it will not create the 'application' or 'public' folders.
In my previous test project these were created automatically. But here the only things being created are
Javascript Resources
PHP Include Path
PHP Language Library
Can anyone help me?
I had exact the same problem !
The answer is simple .
It's because of windows 7 permissions.
Just go to your localhost folder, It's
C:\Program Files (x86)\Zend\Apache2\htdocs
since you are using Zend server.
Right click on it and select "WRITE" permission for users.
Just to make sure I selected all permissions for all categories.
And next time I've created my Zend framework project,it created the structure as well !
Make shure the option Zend Framework default project structure is activated under project layout. You can check out Full featured Zend Framework and Dojo Project as well, but that may generate a little too much.
Try to use one of the existing basic projects and then remove the small amount of stuff that you don't need. See if that works for you.
Note you could also try zf tool and do "zf create project"
I know this is a few years ago, but I thought I'd give an answer as to how I solved this exact same problem. I'm only posting this answer here since a search for this problem turned up near the top of the google results, so I'm not posting for some useless SO points.
In the past, I would create ZF projects in Zend Studio and it would create for me a basic application structure with public, application, library, etc. folders. One day I accidentally deleted ZFDoctrine which I had in my Zend Framework path. Weeks later, when I went to create a new ZF project, Zend Studio created the new project without the familiar basic application structure. I did not get any error or warning so I tried to create the same project using zf Zend tool. At the command line, I received several warnings that ZFDoctrine would not load. So I put ZFDoctrine back in my library path and the problem disappeared. So long story short, it's probably something in the library path.