0

In the past, with Eclipse and a PHP Server/system, I had it setup so that when I commited changes to the CVS repository, it also saved the actual php files on the server. I had this functionality on a another computer in the past (I can't check this computer). The files for the repository seemed to have been saved in a different folder. So the cvs is in a folder stucture like var/cvs and my system files/PHP files facing clients are in something like var/www/html/. How would one go about setting something like this up? I use sftp to change files right now with Filezilla. It was very convenient before being able to commit the changes and check the web to make sure that changes worked. Right now I have to commit the changes then save the file with ftp to see the changes. Would love to be able to get rid of the sftp with Filezilla step if at all possible...

2 Answers2

0

It sounds to me that you are testing your latest changes on the live website, which is bad idea, because if you inadvertently edit some error in the files, your website may expose that to the public.

My current work-flow is as follows:

I use Netbeans on a local project, which is the SVN checkout too. On most projects I use the Netbeans option "Copy files from source folder to another location" to copy the edited files "on save" to the local test webserver directory. If the changes work on the local webserver, I'll commit them to the SVN repository and login to the live-webserver via SSH and checkout the latest revision from the SVN.

So in fact I have four copies of each file:

  1. The working copy (a Netbeans project and SVN checkout)
    /home/feeela/projects/xyz/ (editing here only)
  2. The test-server copy; Netbeans stores a copy there on each save;
    /var/www/vhosts/xyz/ (127.0.0.1/xyz/)
  3. The SVN repository; I'll manually commit files to it after testing on the local webserver;
    /var/svn/xyz/ (svn commit -m "my last change")
  4. The SVN checkout on the live-server, which is the actual website;
    /var/www/vhosts/xyz/ (svn update @ xyz.com/)

I don't have a clue, how setup the "local copy" feature (which can also refer to some other machine) with Eclipse. If someone knows a way to reproduce the above workflow using Eclipse and not need to manually sync the files to the test-server, I#ll be glad to read it here…

feeela
  • 29,399
  • 7
  • 59
  • 71
0

You could use a post-commit hook script on the CVS server to update (refresh) a working copy on var/www/html/. Every time you commit, the hook script would thus get the latest version of the files on the server and put them in var/www/html/.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • That sounds like a good route. I'm wondering if anyone has done it without a script. I feel like Eclipse has all this functionality, because it had been setup that way before for me. maye I misunderstand and there IS sometype of refresh script at work. Is anyone aware of a way to do all this INSIDE eclipse. Let's pretend instead of updating the live server, I'm trying to commit to the cvs repository then updating the dev server to test changes online. Maybe I should just setup XAMPP or something and just manual update the files I updated. I just doesn't seem like the professional way... – Aaron Bell Jun 25 '12 at 17:24
  • I finally figured out the functionality I was looking for. It was the Remote Systems plugin, which allows me to edit and sftp the file within Eclipse. I.e. when I hit save it uploads it as well. So now my workflow is this: 1 production cvs, 1 development cvs. I use remote systems to edit the dev files. When it looks good in the browser/functionality working, I copy the dev file to the dev cvs and production cvs. Then I open the production file in eclipse with remote systems, paste the new code in and save. – Aaron Bell Jun 27 '12 at 22:36