1

I have a Netbeans PHP project with code checked out from a subversion repository. The source files folder is outside my local web server document root. It has three sub-folders trunk, branches, and tags. The branches folder has a sub-folder 'my-branch' (say) which contains the code I am working on (a CodeIgniter project).

I have set the project properties to copy files from the sources folder to the web server document root (htdocs). This copies the trunk, branches and tags folders into the htdocs folder as I would expect.

However I really only want to copy the contents of the branches/my-branch folder to htdocs. I thought that setting the 'Web Root' property (on Project Properties | Sources) to 'branches/my-branch' might achieve this. However, this does not seem to work as I hoped it would.

Two questions:

  1. What is the purpose of the 'Web Root' property?
  2. How (if at all) can I get NetBeans to do what I want?
asterix
  • 183
  • 1
  • 3
  • 12

1 Answers1

0

I believe the best option here is to create a different Netbeans project for the trunk and each branch you want to work on.

The Web Root setting tells Netbeans where the root of your application will be. Some applications have folders and files that won't be exposed on the webserver, but they are still part of the project (in your case think of the htdocs folder being a subfolder inside your project). This is just so Netbeans knows what URL to open if you right click a PHP file in Netbeans and choose Run (Shift+F6)

Say you have these folders in your project:

myconfigfiles\
htdocs\
importantsecretdocuments\

If you set the Web Root property to the htdocs folder you'll notice that for any file inside the other two directories the 'Right click -> Run' option is greyed out.

Say your Project URL is http://localhost. Any file you right click inside the htdocs folder will open the page http://localhost/<selectedfile.php>/. Without setting the Web Root this would open http://localhost/htdocs/<selectedfile.php>

klennepette
  • 3,176
  • 22
  • 23
  • 1
    Ok this makes sense. However, because my source files need to be copied to my web server's document root, I get an error. If I run /my branches/my-branch/index.php, NetBeans copies this file to /branches/my-branch/ and the browser correctly loads http://localhost/index.php except that this file does not exist, because it is copied to /branches/my-branch/index.php and not /index.php. I can see that I should have a project per branch. THANKS – asterix Apr 22 '12 at 12:07