How to set up NetBeans to treat files with an extension as PHP files II

Last week I described in the article How to set up NetBeans to treat files with an extension as PHP files, how to do it in the Early Access build and I mentioned that the NetBeans core team is working on simplifying the procedure. And now the feature is in the build.

If you download a continual or daily build, you can see the Open As ... action in the context menu of files that are not recognized by default. If you invoke it, then the Open As ... dialog opens and you can choose how the files with the same extension will be treated in NetBeans. If you choose mimetype text/x-php5, then files with the same extension will be opened in the PHP editor.

New way how tho treat files as a php files

And you can change it later in the Options dialog.

Options for customizing Open as


Comments:

I think the file type registeration feature must be a basic function provided by netbeans platform.
But this design is too simple.
Why not reference the Zend studio 5.5.
File type of a \*text file\* may be identified by MIME type ,file extension( a single mime type file may be has some different file extensions) , file header declaration ( many xml config file has its special namespace declaration, eg Struts, Spring , JPA persistence unit config file ) or file name sometime(eg. Ant build file build.xml ).
eg.A PHP file can be identified by
mime type : application/x-php
file ext:.php .php3 .php4 .php5 .page(eg.the PRADO php framework template file)
eg. A Spring config xml.
mime type :application/xml
file ext: .xml
name space declaration:<DOTYPE ..> or xml schame...

A file type (text file) is associated with a editor by default.If many editors are registered to process this file type.User can switch different editor.

Posted by hantsy on June 19, 2008 at 12:18 AM CEST #

The described feature is a functionality provided by netbeans platform. I have just demonstrated how to use it.

Everything what you mentioned is supported in NetBeans. If it is not, NetBeans could not recognized Spring conf file from Ant build file or Faces configuration file etc. This have worked in NetBeans for long time. The new feature simplified UI for assigning an extension to a mimtype.

Posted by Petr Pisl on June 19, 2008 at 03:33 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today