I run an open source PHP script, which is being used on all sorts of server environments. I need to detect within PHP whether or not the svn command is available on the server. The idea is that I'll use it as the primary way to download files for installation / upgrading components, and use older methods (manual download) as a secondary method.
I know I can call svn export through PHP with the exec() or system() commands, but what I'm really looking for is a command line function to test for SVN's presence, like:
exec("test svn");
which would (ideally) output a boolean or something.
Any suggestions?
function hasSvn() {
return shell_exec('which svn') != '';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With