tags:

views:

32

answers:

2

I have an issue with accessing an HTML file in an SVN repository. Its contents are displayed as plain text.

What I would like to do is to link to that always up-to-date file from an external website, but I'd like the HTML file to simply launch in the browser (it's a TiddlyWiki file, rather unreadable for human beings in raw text form).

My idea is to simply grab the latest revision of the file and copy it over to my server so that it's accessible as a normal HTML file. Is there a way to easily do that using a PHP script? If there are more than one way, what would you recommend?

If it helps to know it, my server does not have SVN and I have no possibility to install it (it's a shared host).

+1  A: 

Have you looked at the SVN extension for PHP?

Mark Baker
Apparently, I can't use it on my host, but thank you for the suggestion nonetheless.
mingos
+3  A: 

Check if the Subversion module is available on your server. If that's the case, you can easily create some script that connects to the SVN server and gets the newest file.

If you don't have that module, I can think of two possibilities:

  1. If your SVN server has some kind of web interface, you could simply do a HTML download from the web interface. Depending on the kind of web interface, you might need to extract the file's source out first.
  2. You can also add a postcommit hook to the SVN server that uploads the file to your website; but given that this requires you to change the SVN server's configuration and also puts a direct connection to your website, it might not be what you want.
poke
+1 for the web interface option, it is the only way to get a file from a SVN repository if no SVN is available on the server what so ever. Eventually, you don't even have to download the file to the server, you can easily just link to it! :)
Pelle ten Cate
+1 for alternatives to the SVN module
Mark Baker
Since it's a shared host, I don't have the possibility to add the SVN module, and it doesn't seem to be available, at least phpinfo() doesn't say it is. Thanks for the alternatives though. I managed to get the file contents from the web interface as a simple string. I'l just overwrite the contents of the file and that should do the trick.
mingos