Jump to content

Executing SVN command through PHP


everbright

Recommended Posts

Hi all,

 

I'm trying to create a simple PHP script for backing up my SVN repositories via svnadmin.exe. My environment is as follows:-

 

OS: Windows 7

PHP version: 5.2.12

SVN (VisualSVN): 1.6.6

 

Here's my PHP code sample:

 

system("\"D:/VisualSVN/bin/svnadmin.exe\" dump \"E:/VisualSVN/Repositories/MyProject\" > \"E:/PHP/Batch Scripts/ServerBackup/Backups/20110311/svn/MyProject.svn\"", $code);

print "Code: $code";

 

The result of this script is that the error code is 1, which means the command isn't dumping out the data as expected. However if I run the command manually through a command console, the data comes out fine, and I get MyProject.svn generated as expected.

 

I'm executing the PHP script using a command window that's running as Administrator, so I don't think it's a permission issue.

 

Any ideas what status code 1 is for svnadmin.exe? Also does anyone know how to get this working?

 

Thanks in advance for any suggestions!

Link to comment
https://forums.phpfreaks.com/topic/230336-executing-svn-command-through-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.