Skip to content

NetBeans for PHP weblog
Syndicate content
Updated: 1 hour 49 min ago

Line wrapping. Help us

Thu, 07/22/2010 - 14:28

Guys from editor infrastructure asked me to help him to test new editor infrastructure that brings up also line wrapping features. Probably you remembered that this feature was enabled during NetBeans 6.9 development, but because it introduced many problems and there wasn't time to stabilize it enough, it's not in NetBeans 6.9 available. 

We would like to stabilize the new infrastructure as much as possible before it will be switch on to be be available by default.You can enable the feature in development build through command line option: -J-Dorg.netbeans.editor.linewrap=true . Do it only with a development build, even if the optoin works in NetBeans 6.9, the new infrastructure is not stable enough there.

So I would like to ask you, if you use a latest development build, run the build with the mentioned option. You can start NetBeans from command line with the option or place the option in the ${nb_dir}/etc/netbeans.conf file (add into netbeans_default_options).

When you started NetBeans with this, there should be Line Wrapping option in the formatter.

When you find out an issue with it, please report it in our Bugzilla. For such issue the product should be Editor, component Painting & Printing and please mark all reports with the status whiteboard: linewrap so we can easily track them. The tentative plan is to enable this again for M1 of NetBeans 6.10 but this all depends on the additional feedback and testing.

Thanks for your help with this.



Categories: Open Source

Several improvements

Mon, 07/12/2010 - 11:43

Today, I would like to show you several improvements we have implemented in our PHP support. Have a look at the following picture, can you see any of them?

PHP Improvements

I think that most of you have noticed that:

  • PHP projects with framework(s) are annotated with framework icon (together with improved tooltip)
  • PHP frameworks tell project which files are important
  • we have new icons for INI files and Include Path node

 

That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans Bugzilla (component php, subcomponent Project). Please notice that if you write a comment here but do not report a bug or enhancement, nothing will probably happen ;)

Categories: Open Source

Run file without project

Tue, 06/29/2010 - 14:17

Today, I would like to introduce an improvement that is related to PHP files which do not belong to any PHP project. In NetBeans, these files can be not only opened but also run or even debugged. Just open a file, right click in the file content and choose Run File (SHIFT + F6) and the following dialog appears:

Run File dialog

As you can see, one can provide script parameters, change working directory or even specify PHP parameters (useful, for example, if one wants to change PHP include path). If one runs the script always with the same parameters, it is useful to remember these settings so the IDE does not ask you again.

Similarly, if one wants to debug an opened file (CTRL + SHIFT + F5):

Debug file dialog

As you can see, the same dialog is used.

One more note - because the files do not belong to any PHP project, running (or debugging) is done only via the PHP command line interpreter (can be found in Tools > Options > PHP > General). This means that the output can be reviewed in the Output window:

The Output Window

That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans Bugzilla (component php, subcomponent Project). Please notice that if you write a comment here but do not report a bug or enhancement, nothing will probably happen ;)

Categories: Open Source

Is the IDE Slow? Send a Profiling Snapshot

Wed, 06/23/2010 - 13:25

In NetBeans 6.9 is available Profile me Now! feature as well for PHP distribution. This feature generate a snapshot to understand what's going on if you think that the IDE is slow. By default the feature is not visible and you have to enable the IDE's self-profiling feature. Go to View main menu, then choose Toolbar and enable Memory toolbar.

Now you should see Memory toolbar and also Profile Me button.

Prepare the IDE for the operation that seems to be slow. Press the Profile Me button or use shortcut ALT+SHIFT+Y to start to collecting data. The icon of the button is change during profiling.

Perform the operation and when it's done, press the Profile Me button again or press the shortcut ALT+SHIFT+Y to stop profiling.

IDE creates a profiling snapshot and because there is not Profiler installed by default in PHP distribution, an information dialog is displayed with the path where the snapshot is saved.

If you don't use PHP distro or you installed the Java Profiler (the Java Profiler requires java support), then the snapshot is opened in NetBeans. In this case you have to save it via Export to ... button.

To provide a useful snapshot as much as possible, try to isolate the problematic operation so the snapshot doesn't contain other irrelevant data. For different problems create separate snapshots. Make sure there are no other CPU-heavy tasks running on your computer.

The CPU snapshot is in fact a set of thread dumps taken several times per second (sampling technique). It has a very low overhead, so almost does not affect the running IDE. It is not suitable for profiling very short operations (under 1 second). The snapshot contains no memory data. In case of problems with memory, see how to create a memory dump.

Check the memory bar to make sure the IDE does not run close to memory limits (click the bar to force garbage collection). In such case the slowness is caused by frequent garbage collections, and the whole problem is likely memory-related. You might see OutOfMemoryError too. In such case a memory dump is needed.

Categories: Open Source

Create support for your favorite PHP framework

Mon, 06/21/2010 - 10:07

Today, I would like to inform you that we have created a wiki page which could be a starting point for all of you who would like to create a support for your favorite PHP framework (Java knowledge is needed). All the relevant information should be found there, we hope that you will find it useful.

Categories: Open Source

NetBeans 6.9 is Available

Wed, 06/16/2010 - 09:38
After bug fixing period NetBeans 6.9 final build is available. You can download it as usual from NetBeans site. What is new, you can read in this document and also you can watch some new features in NetBeans 6.9 Overview video.

 If you use the IDE just for PHP development, I recommend to use the PHP distribution. If you run in to an issue with NetBeans 6.9, enter the issue to our database to be fixed in patch release.

Yesterday there was closed a poll "What language do you plan to use for your next project?". 8232 users answered the poll and PHP has second place (32 %) that is nice result.

Categories: Open Source

Spellchecker

Thu, 06/10/2010 - 14:21

Another new feature in NetBeans 6.9 is a spellchecker. You can switch on / off the checking for different files in Option dialog. 

In the dialog you can add and remove new dictionaries and also set the locale - which dictionary will be used for spell checking.  When you want to add new dictionary you have to have a file with the words. The format of the dictionary file is very simple, just every word on new line. Also you have to say to NetBeans in which encoding is the dictionary file and for which locale the file should be used.

Unfortunately today I have noticed a bug (issue #187425). When you add your dictionary, then the original disappear. There is a workaround for this, delete the folder dict from your userdir. It should be located in {userdir}/modules/dict . The bug should be fixed and should be available in the patch release for NetBeans 6.9.

The spellchecker works also for PHP files, where the HTML text is checked. If there is a word that is not in the dictionary, then is underline and tooltip says that it is Misspelled Word.

When you place a caret inside the misspelled word, then on the left side yellow bulb appears. You can click on the bulb to open the popup window with hints or you can also open the window through ALT + ENTER shortcut.

As you can see on the picture above, there are hints that suggest the possible correction or you can add new word to a dictionary. There are two possibilities, where you can add the unknown word. Project dictionary  and private dictionary. Private dictionary is your dictionary that is global - the word is known in all projects. The project dictionary is located in metadata folder in project.xml file and if you share the metadata via a VCS, then the dictionary is shared also with other people.

There was not enough time to integrate fully the spellchecker into PHP and there is a lot of space for improvements, like the spellcheker could check php comments, the locale could be per folder or file etc. I hope that there will be enough time next release to improve it.


Categories: Open Source

Terminal emulator

Mon, 06/07/2010 - 15:44

Today I would like to mention a new feature in NetBeans 6.9 that allows run terminal in NetBeans. The module is marked as experimental, but it can be useful, when you don't want to switch between a terminal and NetBeans. You can open it from the main menu Window -> Output -> Terminal (Experimental).  

When you invoke the action new window is opened in the output window area. The terminal window has two icons on left side.  

The  first icon opens terminal on local computer. You can do everything as usual.

The behavior is the same as in the real terminal.  You can run processes, other programs etc.

The second icon opens remote terminal. You have to have SSH access to the remote server to use this capabilities. 

The pictures are from my Ubuntu machine. I have not tried it on other platforms yet. If you have any problem with this module, please file a bug in our database for cnd product, terminalemulator category.

Categories: Open Source

Enable auto-scanning of sources - Scan for External Changes

Wed, 06/02/2010 - 16:58

NetBeans 6.9 contains a feature that automatically looks for external changes to keep informations about files up-to-date. We have some reports that it can slow down NetBeans mainly, when an open project has many folders. When NetBeans find out that files were externally changed, it re-scans the files to keep data up-to-date that are used with features like code completion, navigation etc. Unfortunately the notification and following re-scanning can take some time and during this time many mentioned features are waiting for the finishing of scanning. There is option Enable auto-scanning of sources that can switch off this behavior. The option you can find it in Options dialog, Miscellaneous category and Files tab.

The default behavior is that NetBeans also looks for external changes when the main window gets focus. This is can be during developing a web application very often when user switches between browser and IDE. The mentioned option also switch this off.

When you switch off  option Enable auto-scanning of sources you can still keep the information up-to-date, just invoke Scan for External Changes  action from Sources menu manually.



Categories: Open Source

NetBeans 6.9 RC 1 is available

Wed, 05/26/2010 - 15:32

The first release candidate of NetBeans 6.9 is now available. You can download and read more here. So far there wasn't any show stopper in the PHP area and we hope that the final build will be realeased according the plan.

Categories: Open Source

NetBeans 6.9 - Code Freeze Reached

Wed, 05/19/2010 - 10:58
Yesterday, the 18th of May was created clone for NetBeans 6.9 from the main repository and code freeze for the release was reached. It's the next step to published final build. The first release candidate should be available soon.

Now only stoppers can be fixed in the NetBeans 6.9 clone. If you know about such bug, don't hesitate and enter it in our Bugzilla.

Categories: Open Source

Framework support improvements

Mon, 05/17/2010 - 10:38

Hi all, today we will have a look at the latest improvements that can be found in NetBeans PHP Frameworks area. We believe that the most important feature is that code completion in view (or template) files now offers variables from controller (or action) files - this works for both, Symfony and Zend Frameworks. So, let's have for example this controller:

Symfony controller

One can see that we pass a pager variable to our view template so now, we can see it in code completion in view file:

Symfony view

Please notice that the $pager variable is not only listed in code completion items but that NetBeans also knows its type and the file where it is defined. That means that Go To Declaration (CTRL + click) works as well and of course, we can find all the public methods and fields in code completion for the $pager variable itself:

Another Symfony View Sample

Other minor improvements can be found in navigating and running framework commands - now, one can use just one shortcut for navigating from action to view and vice versa and NetBeans automatically calls the correct framework support. The same applies for running framework commands - no need to specify two shortcuts, one for Symfony and one for Zend. These shortcuts can be changed in Tools > Options > Keymap (the default for Run Framework Command is ALT + SHIFT + R).

That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans Bugzilla (component php, subcomponent Symfony or Zend). Please notice that if you write a comment here but do not report a bug or enhancement, nothing will probably happen ;)

Categories: Open Source

Generate Overriden & Implemented Methods

Thu, 04/29/2010 - 14:43

After invoking the shortcut ALT+Insert (CTLRL+I on Mac), all possible generators are offered. In 6.9 we have added next one: "Generate Overriden & Implemented Methods" (press mentioned shortcut in class declaration - between class members). See the picture below:

generate_overriden_methods

It is complementary feature to already existing features like:

 overriden methods

More about other code generators can be found in previous blog entries:

Categories: Open Source

Values of Constants

Thu, 04/22/2010 - 08:59

After a few days I have found a minute to write a short blog post. Thanks to Radek, in the development build of NetBeans 6.9 values of constants are displayed in Navigator window and also in Code Completion window. As you can see on the picture below, the values are displayed for the global constants and for class constants as well. 

The value of a constant also appears in the documentation window  for the selected code completion item.

Categories: Open Source

CodeSniffer plugin for NetBeans PHP Editor

Tue, 04/20/2010 - 13:53
A fellow named Benjamin Eberlei has created a new and improved NBM file for the CodeSniffer plugin. Details and a download link are available at his blog.
Categories: Open Source

[UPDATED] Smarty update - custom delimiters

Thu, 04/15/2010 - 10:13

Thanks to Martin Fousek again! 

Project related custom delimiters can be set in Project Properties of every project which contains Smarty template files. Default empty fields mean use global settings for them.

Smarty Delimiters for Project

Global settings is accessible from Tools -> Options -> PHP -> Smarty. By default are standard "{" and "}" used.

Default Smarty Delimiters

As before please report all issues you find in NetBeans IssueZilla > contrib > Smarty, thanks.

UPDATE: If your project is not recognized as a "Smarty" project, as a work around, put a Smarty file (usually any TPL file) directly in your Source Files. We know about this problem and it will be fixed soon. If this work around does not work for you, please, report issue, provide your NetBeans and Smarty pluginn versions and attach a sample project we can investigate. Thanks a lot for your cooperation.

Categories: Open Source

[UPDATED] Are you using daily builds?

Mon, 04/12/2010 - 09:32

This message is for all of you who are using NetBeans development builds. You probably have noticed that right now, they are quite slow and unstable. If you want to fix this, please, start the IDE with -J-Dorg.netbeans.editor.linewrap.disable=true -J-Dorg.netbeans.editor.linewrap=false (see issue #183795 for details), it should be OK.

Thank you all for testing our latest NetBeans versions and for reporting all the bugs, it is very helpful.

Categories: Open Source