dev_file_control.jpgSo over the last week I have been working on and off with a PHP frontend to SVN. The frontend needed to be designed in such a way that each developer could access their working copies and make the full range of actions against them. I decided to also use an AJAX setup so that pages would be quickly loaded and updated by a single toggle of a folder. The first issue that I had to deal with was when a SVN command was issues it needed to be issued as the owner of the code so that SVN could track edits correctly. After googling around for a bit I quickly realized that there was not a viable Apache MPM that would serve virtual hosts under different users and groups. Then the light bulb flipped on, setup a proxy and redirect requests to developer.dev.domain.com to its own instance of apache running as the user and group ‘developer’. This would ensure that all SVN commands would run as ‘developer’ when executed. I then moved onto setting up the interface. The features that are working at this time are:

  1. create working copy from repository (svn checkout)
  2. delete working copy
  3. svn add
  4. svn blame
  5. svn commit
  6. svn copy
  7. svn delete
  8. svn diff
  9. svn move
  10. svn propset
  11. search files (via a grep/find combination, omitting .svn folders)
  12. svn log
  13. svn rename
  14. svn status
  15. update local working copy
  16. update stage environment
  17. publish stage environment

A few things that I learned while working with doing the SVN commands was that when executing a command via the php function exec() I need to add the flag –config-dir=$USER_HOME_DIR/.subversion (or where ever the users .subversion folder is located). Also if a command does not seem to be executing correctly you can add “2>&1″ without quotations to the command being run and it will return any error messages through the $ouput variable for exec();

9 responses


Do you want to comment?

Comments RSS and TrackBack Identifier URI ?

Hi Robert,

Have you looked at VersionControl_SVN in PEAR? Has a few bugs (that are fixed in a release on my HD), but may speed your process a bit.

-Clay

February 1, 2007 11:45 am

You might also check out (if you have not) websvn:
http://websvn.tigris.org/

February 2, 2007 4:21 am

I actually am all done with this little project. I looked at both the PEAR package as well as the websvn setup. In the end they did not do what I wanted them to do. The frontend I created actually is a bit different than the two mentioned above. This frontend actually runs on an instance of apache for each developer and executes the svn commands as that user. Basically it is a frontend for a remote working copy, if that makes any sense.

February 2, 2007 9:08 am

Hey, any chance that you’ll share the source for this? It’s pretty similar to something I’ve been thinking of making lately and I’d like to try it out and maybe help out.

May 14, 2007 3:40 pm

Yes, in the future I do plan on releasing it. The code needs to be cleaned up and some comments added. It is very proprietary right now.

May 20, 2007 11:44 am

It’s nice

June 30, 2007 9:01 pm

Hi,
I am very interested in these script, Are they released, where could I download them ?

Thanks
timothe

November 4, 2009 10:42 am

Hi, I realize this project of yours is very old, but I must say, Im searching for a php frontend for remote working copies, and it just doesnt exist out there and will do what I need. You mentioned that you were going to release this code, have you? As I havent seen it posted anywhere, and if you havent, would you consider doing so even though it’s quite bit later?

Thanks

-Garrett Marone

January 29, 2010 1:04 pm

Thanks for the ’2>&1′ hint. Everything ran and gave me nothing back, couldn’t figure it out. This is a lifesaver. Thank you very much!

March 17, 2010 3:18 pm

Comment now!
















Trackbacks