Simple SVN checkout using PHP


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // http://www.fordnox.com/blog/2008/11/simple-svn-checkout-using-php/
  2.  
  3. $username = "username";
  4. $password = "password";
  5. $repository = "http://google-web-toolkit.googlecode.com/svn/trunk/";
  6. $destination = ‘your/full/path’;
  7.  
  8. $checkout = "svn export –force –username $username –password $password $repository $destination";
  9. $result = _exec($checkout);
  10.  
  11. function _exec($cmd)
  12. {
  13. if (substr(php_uname(), 0, 7) == "Windows") {
  14. pclose(popen("start /B ". $cmd, "r"));
  15. } else {
  16. exec($cmd . " > /dev/null &");
  17. }
  18. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.