3

Is it possible, with or without plugin, to add more source folders to a PHP project, just like in a Java project?

I have downloaded and tested the Java version of NetBeans, and there is clearly possible to add more source folders. But not in the PHP version?

Atmoz
  • 31
  • 1
  • 3

5 Answers5

5

you can add paths for all newly created PHP projects from:

netbeans options > PHP section > Global include path

or you may add project specific include paths in a project's "project properties" (right click on a project in the projects view", and then choose "PHP Include Path" from the left side section.

although you are not allowed to edit a project included sources. you might as well create an additional project in Netbeans and call it like "my-include-path", then add all the folders in your desired include paths to this project. now you can edit your included files in this project.

farzad
  • 8,775
  • 6
  • 32
  • 41
1

When you right-click in the projects panel (Netbeans 6.9.1), there's an option 'Project Group'. This allows you to add the current projects (In this case the php and the js project) to be grouped and opened as one.

Also useful to automatically open additional projects used for reference.

TBeijen
  • 21
  • 3
0

Under project properties, the source folder is only one. However, you could add folders to the PHP Include Path if you are trying to use files from another folder.

Gerardo
  • 1,928
  • 4
  • 24
  • 34
  • I need to edit the files too. In many of my projects the PHP files and JS files is in two different places on a shared host. I could add the common parent folder, but that is so high up and will cause NetBeans to scan every site on the host, and that's not a good solution. – Atmoz Feb 18 '10 at 10:13
0

At this time, it looks like NetBeans PHP projects does not support multiple source folders.

I have added a feature request to the NetBeans' Bugzilla: http://netbeans.org/bugzilla/show_bug.cgi?id=180889

Atmoz
  • 31
  • 1
  • 3
0

"Global include path" and "PHP include path" does not work for me.

My personal solution is to add the extra_path before the include/include_once statements in this way:

set_include_path(get_include_path() . '$extra_path);
Freeman
  • 5,810
  • 3
  • 47
  • 48