tags:

views:

29

answers:

1

I've just discovered http://www.php.net/manual/en/ref.svn.php, which is actually what I've been looking for for a while.

I am able to use svn_ls to correctly list directories and their files, which is perfect, but for the next part of my S3 deployment script, I need to be able to use svn_fs_file_contents. Unfortunately, I am unable to correctly getting it working. It says it needs a resource, but even with experimenting, I am unable to get it working.

Has anyone used these functions before and got a basic working script together that enables you to pull file contents, etc?

This would be a huge help, any point in the right direction is hugely appreciated.

+1  A: 

Well, based on the docs, it seems that you'd need to do a few things first:

$repository = svn_repos_open('svn://server/path/to/svn');
$fs = svn_repos_fs($repository);
$file = svn_fs_file_contents($fs, 'path/to/file');

But, let me ask you these questions. Why do you need read/write access to svn? Can you get away with using system calls (exec('svn update');)? Can you get away with using WebDAV access to the repository?

ircmaxell