X

An Oracle blog about NetBeans for PHP

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


Join the discussion

Comments ( 2 )
  • hantsy Wednesday, June 18, 2008

    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.


  • Petr Pisl Thursday, June 19, 2008

    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.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.