views:

429

answers:

1
+4  Q: 

Best PHP Workflow

I'm wondering what the best way to work with PHP web pages in Eclipse.

For instance, what I normally do is create a project with remote links to the files on the server. This way I can make changes->save them->and instantly see the effects in a browser.

However, this method does not allow me to commit the remote files to SVN. I could have a local working copy checked-out from SVN; then copy/export the files to the server every time I made a change, but that gets annoying fast.

My question is what is you workflow or method for working/debugging/testing/committing PHP projects in Eclipse?

+5  A: 

Be sure you create your project local first. Commit it to a local server with SVN. The way you are uploading your files directly to the remote server is very dangerous. Every time you do a save of your file, it becomes possible to upload bugs. Be sure to follow this or a similar way:

  • work local
  • test local
  • merge with local SVN (other people working on this project will commit their code in this same branch)
  • test the branch before uploading to remote server.

now you are sure to upload a correct version of your file.

  • try to insert automatic unit tests
  • take a look at tags, branches and trunks (to work correctly)

in the first few weeks you will create a lot of versions but after a while you will start to bundle your bugs into 1 update every week (or something like that)

Kennethvr
+1 - I think what Kevin is missing the most is a local development environment (eg. XAMPP).
Philippe Gerber
@Philippe Gerber: Your probably right. But as my development computer is also the test environment, and is also my personal computer, I am trying to keep it as lean as possible. Still, you do give me and idea...@Kennethvr: I understand what you are saying. But even to test local I have to upload/copy/export to the test server folder location. A waste of time if it cannot be automated.
Kevin Hicks
@Kevin Hicks Those kind off things can be automated, off course this will take some time to be created. We are using Symfony as PHP framework and that has the possibility to do automated uploads to a test/production environment. take a look at Ant in Eclipse.
Kennethvr