sublime text 3 hints as in NetBeans - php

is there any extension that provide hints (autocomplete) in Sublime Text 3 as it in NetBeans?
Not just php functions but all object methods, attributes and so on. Basicly it is usefull when you use OOP, frameworks etc.

You should take a look at SublimeCodeIntel. Quite nice, and works not only with PHP.
You can install it via Package Control. The GitHub repository of the project also tells you how to install, if not using Package Control. (I happened to have bugs with the package control version, so I also installed without package control, but first try that, my friends didn't have my issue.)
Keep in mind, that Sublime does not have an API that would make possible the same user experience. With this extension you'll get lists like the autocomplete. These lists can also contain PHPDoc, but not in a separate tooltip window, like in Netbeans. IMHO it still is very-very useful, and it might satisfy you.

you can use "Intelli​Docs" plugin
https://sublime.wbond.net/packages/IntelliDocs
press F2 key on the function
but not working in the popup

ya you can install AndyPhp package in sublime text 3.

Related

How to exclude library from autocomplete in Netbeans?

As I try to use the auto-complete pop-up window in Netbeans on my PHP project, a huge swath of CakePHP methods tend to fill the window, and it makes finding what I need more difficult. (I'm not even using CakePHP in the project...)
Is there a way to prevent CakePHP which I am not using, or generically any other library, from showing up in that window?
Thanks.
Update:
Disabling cakephp did remove it from the autocomplete window, but it looks like my primary issue is with the fact that netbeans didn't seem to know what object I am referring to in these cases (because it is a global/defined elsewhere)
When it knows the exact class it provides a proper list of methods to choose from. There seems to be a "red dot" graphic beside methods related to the object, and this "thought bubble" type graphic beside ones that are just grabbed from all libraries netbeans knows about
The only way I have in my mind for this moment is to disable the CakePHP plugin. I have installed it separately so the path in my IDE is Tools -> Plugins -> User Installed Plugins (which is PHP CakePHP Framework).

Generation of Class Diagram from XMI

Situation
I have a PHP project with lots of classes with lots of relationships in lots of folders following the Zend Naming Convention.
I use the NetBeans IDE 7.1.
I work under Windows 7.
Goal
I need to see a graphical representation of the class relationships, possibly in varying depths and varying degrees of complexity. Also, it would be nice if the classes in the diagram are clickable. I do not necessarily need to generate documentation.
Attempts
1. Within NetBeans
NetBeans is an awesome IDE with lots of features. In fact, it recognizes class dependencies, and it would be wise to assume that it has some sort of way to graphically view this relationship, natively, or through a plugin. Such a plugin exists, but is for version 5.5. I have 7.1, and it's not compatible. Fail.
2. Enterprise Architect
A simple google search brings up Enterprise Architect as an all-capable, completely comprehensive tool for solving such problems. So, I download and install. I'm not going to go to the detail of how I couldn't understand how to do anything, and how the tutorials are bragging about what the software can do, but rarely say how.
So, I imported the source. It generated many different classes and parsed all the members. Also, it generated the class diagrams. "Perfect!", I though, but alas. The class diagrams only show relationships between classes, the files of which were in the same source folder, despite the relationships being visibly registered in the classes' properties. A search for documentation on how I could merge all these diagrams into one was unsuccessful. Fail.
NOTE: I created a parallel thread before this one here.
3. PHP_UML
Found this PEAR tool. Looked good. So, I read through documentation on how to install it for my setup from various sources, and ran it. First, I used the html output format. Great! Lots of documentation with an index, bla bla bla. However, the best it could do in the direction I want was this:
Needless to say, I guess, that this is a very poor, super simplified version of what I actually need. Conclusion: fail.
4. Enterprise Architect + PHP_UML
However, PHP_UML can also generate XMI. Wow. Very nice. I can store my relationships and view them in different ways and exchange with other people.
So, I imported it into Enterprise Architect. Result: same as before with Enterprise Architect alone, only no class diagrams. Just the classes. As far as I've read about it, I can now manually create the relationships. Epic fail.
5. ArgoUML + PHP_UML
Somewhere through my search for solution I stumbled upon someone's comment that said they use ArgoUML. Downloaded and installed. XMI imported with some hassle (had to change version explicitly to 1). Fail (see Attempt 3).
Conclusion
Such a seemingly trivial task, and yet, so difficult. Do I have to go through this whole list, trying out each application?
One of the ways to do this would be to take the approach illustrated in my attempt 2 or 4,
and then follow instructions given here for Enterprise Architect.
To generate an XMI file using PHP_UML:
Follow these instructions to install PEAR if not installed already, if you have PHP installed separately.
If you are using XAMPP under Windows (my case), follow these instructions to add PEAR to the PATH env variable and thus make PEAR available through CMD, and to learn how to install packages in both *nix and Windows systems. Hint: the PATH separator is ";" (semicolon) for Windows.
In some setups, like if using XAMPP, you may need to activate the XSL extension. In this case, open your php.ini file (you may need Administrator privileges to save it), and uncomment or add the following line to the bottom of the "Dynamic Extensions" section: extension=php_xsl.dll.
Install the PHP_UML package with pear install PHP_UML.
Execute phpuml -f xmi -o name_of_output_dir. If you're planning to use the generated XMI with some older programs later, you may need to specify XMI version 1 by adding -x 1.
For me, this did not work immediately, saying that I am missing ../../data/xmlschema.rng. Not sure why this happened, but if you get a similar error, you can download it from here and place it into the data folder right under your PEAR directory.
This XMI can later be used with Enterprise Architect, ArgoUML and other XMI tools.
(Edit : This answer is an alternative for people that want to generate UML class diagram from a PHP project, it doesn't explains how to read XMI files)
Goal
I need to see a graphical representation of the class relationships,
possibly in varying depths and varying degrees of complexity. Also, it
would be nice if the classes in the diagram are clickable. I do not
necessarily need to generate documentation.
If your goal was to generate a class diagram from a PHP project, I found a better solution than use PHP_UML. What you probably want is BoUML, with this software, you can select a PHP project folder and reverse engineering it. Then create a class diagram. When you drag&drop the class on it, the relations are there unlike AlgoUML (If I'm not wrong). XMI files are no longer useful in this case.

which package of tinyMCE is to be used?

I want to use tinyMCE for adding content to front end. I got a link for downloading latest version of tinyMCE
But I am confused to choose among TinyMCE 3.5.5 development package and TinyMCE 3.5.5.
Please let me know which one is suitable to implement. I am using php 5.2 with symfony 1.0 framework.
Thanks
Navigating to the official tinymce download page you will be offered 3 different versions of tinymce:
TinyMCE 3.5.5 regular package
TinyMCE 3.5.5 jQuery package
TinyMCE 3.5.5 development package
The first one is the package for regular production use. This is usefull if you do not wish to make any changes to existing core files or add any custom plugins.
The second one is called "jQuery package". This one allows a developer to treat the tinymce editor instances as jQuery objects and use jQuery style like operations. (I strongly advise everyone not to use this package, because it is a source of trouble and is slow when it comes to keyboard input handling due to the object creation overhead).
The last one is a developer package. This one contains the regular build and can be used in the same way. By including tiny_mce_dev.js instead of the regular tiny_mce.js the non-minified tinymce files like classes and plugins are getting loaded and easier debugging is possible. It is a good choice to use this package if the downloader plans to write own plugins or develop/use a very complex tinymce configuration setting.
It does not really matter which one you choose, both with be exactly the same. The only difference is that TinyMCE Developer version will allow you to make changes to the source (which is javascript).
I have been using TinyMCE for a couple years now for custom Content Management Systems, and I have never felt the need or had a reason to edit the source.
Conclusion: The regular version 3.5.5 will almost certainly be good enough.
Use either one.
The Dev package just gives you bunch of extra stuff including a non-minified version of the script.

Need assistance finding the perfect PHP IDE for Ubuntu

I'm trying to build an application in PHP using my Ubuntu laptop. I'm having a hard time, however, finding an IDE that fits my needs. My ideal IDE would have the following features:
Code folding
Easy code snippet creation that is assignable to a shortcut key
Code organization
Unit Testing
Debugger
Netbeans fits most of these requirements except that the ability to create snippets is complex. One must create a module file and then screw around with some XML and do the hokey poky to get a super simple snippet installed. I tried creating a macro in NetBeans, but it screws up the javadoc and I have not figured out a way to tell it to just paste in what I type for the duration of the macro rather than using all of the human assistance features. So what I get is a bunch of jacked up looking code with jacked up phpdoc.
gPHPEdit is more of what I'm looking for as far as snippet support, but it sorely lacks all of the other features that NetBeans does so well.
Any ideas on a great PHP IDE. Since this is a personal project, purchasing an IDE is not an option.
In NetBeans, you can make code templates. These are abbreviations with variable support, what you can complete with a selected key (tab, ctrl+enter etc).
You can find it under Tools -> Options -> Editor -> Code Templates.
I use Aptana which is build on top of eclipse or can be used as an eclipse plugin. It comes with some basic snippets and creating new snippets isn't that hard with eclipse.
I would recommend to start with the 3.0 beta as it has some new features that are quite useful. Apatana has almost everything you need and as it uses eclipse, you will get almost everything that is missing (like SVN or GIT support).

Eclipse Auto-Complete for Included PHP Source

I've installed Eclipse 3.5.1 (PDE), which I believe I got from Zend's download site (it was a while ago on my travel laptop). I can't get auto-complete to work for any of my included libraries. I've tried both adding the libraries to the 'include path' and just linking the files to a subdirectory of the project. Neither gets me auto-complete of the library classes.
My normal development system has an older version of Eclipse which I don't update, because it currently works well, and I fear an update will change that. I find configuring eclipse more work that actual coding, and more voodoo that mod_rewrite. I doubt I'm alone.
Any secret to getting auto-complete working?
No you're definitely not alone! I have experienced this problem in many installations of Eclipse (after updates and such etc etc). Try running Build Project. I know that solution has worked in some instances for me. My last installation I was running Eclipse Galileo and once I finally got the intellisense to at least work it was extremely slow. I tried lowering the time delay for the intellisense which helped in php files (still had a 1.5 second delay at least) but made it way over-sensative in my view scripts for example.
I finally bit the bullet and switched to Zend Studio 8. (At least they've knocked the price down $100 haha).
Eclipse has a quirky auto-complete but the Zend one is excellent! :)
You can add a PHP library to the project in Project properties/PHP Include Path/Libraries. After that, autocomplete will index all php files in that directory.
Maybe it's not the best solution for you, because it doesn't care about whether the file is included or not in the given script. If I include /usr/share/pear, and now I see all PEAR libs' functions everywhere.

Categories