开发者

php script which updates svn working directory

I want to write a php script which updates svn working directory

I tried with below code , but it does not work.I guess because the USER for php script is "apache" but for svn update it needs to be "homeuser"

    putenv("USERNAME=homeuser");
    putenv("HOME=/home/h开发者_如何学JAVAomeuser");  

    exec("svn update /home/homeuser/path/to/working/dir", $info); //svn update with full path

    print_r($info);

how to get around ?


First, it seems like a bad idea to have a PHP script do this. But anyway, if you must - you could try creating a shell script to do the svn update and then use the PHP system function to execute that script.


There's nothing you'll be able to do with PHP to fix this - it's all in the *nix permissions.

The "apache" user will need to be given permission to execute svn update.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜