tags:

views:

919

answers:

2

I'm learning Eclipse PDT for PHP development. In pretty much all tutorials I've read they put the eclipse workspace inside the document root of the webserver (htdocs in my case).

Is this common practice? I mean; I don't like the configuration files on my (test) webserver. Isn't there a way to publish the changes to webserver's folder from the workspace elsewhere on the filesystem?

A: 

You can have the workspace in one directory, and projects in any other directories you'd like (not necessarily sub-directories of the workspace).

The location you specify as "workspace location" is the place where some configuration files (internal to eclipse) will be stored, I believe.

On my (Linux) machine, I have :

  • the workspace location in /home/squale/bin/eclipse-workspaces/1
  • projects are in /home/squale/developpement/ :
    • aggregator
    • php-src-5.3
    • ...

On my Windows machine at work, I have :

  • workspace location is something like d:\bin\eclipse-workspaces\pdt-1\
  • I have a project on a hard disk (like d:\projects\project1 )
  • And another project on a network drive (which points to a Linux server, through samba)

That way, too, workspace files are in a really separate directory, not deployed to any server, and not in the SVN's checkout structure or even near it.

Putting the workspace inside the docroot is maybe easier, but works only if you have one virtual host, anyway (and not a couple of projects, so).

With older versions of Eclipse, sometimes, when Eclipse crashed, the workspace was totally corrupted, and had to be deleted ; not habing the projects' files in sub-directories of the workspace was really useful, by then.

Pascal MARTIN
It's not working...I set my workspace to c:\eclipse\workspace and I made a custom htdocs directory at c:\webserver.Eclipse created a folder called ".metadata" in the workspace folder. No problem here.I created a new PHP project and chose "Create a project from an existing source" and I selected an empty subfolder of c:\webserver.Well Eclipse just created two files (.project, .buildpath) and a directory (.settings) in the new subfolder :(
Erik
oh, yes, I didn't think about those ones :-( the workspace files (metada, configuration of eclipse, common to all the projects you're working on) go to the workspace directory, but the project's specific files go to the projet's directory -- i don't think there's much you can do about those ones, except add them to snv:ignore or the equivalent for the RCS you are using (and take that into account while writing you build script to deploy to the production server -- I've never seen them do any harm when present on the development server, ie my machine)
Pascal MARTIN
Hmm, I'll just have to deal with it then. Thanks for the info though. At least I got my workspace in a seperate folder now.
Erik
A: 

You can also try setting up a local repository and using svn:externals, tho' I'm not a pro at knowing how to set those up.

American Yak