检测服务器上的 svn 是否可用(在 PHP 中)
我运行一个开源 PHP 脚本,该脚本正在各种服务器环境中使用。我需要在 PHP 中检测 svn 命令在服务器上是否可用。我的想法是,我将使用它作为下载安装/升级组件文件的主要方法,并使用旧方法(手动下载)作为辅助方法。
我知道我可以使用 exec() 或 system() 命令通过 PHP 调用svn导出,但我真正寻找的是一个命令行函数来测试 SVN 的存在,例如:
exec( “测试 svn”);
(理想情况下)它会输出一个布尔值或其他东西。
有什么建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)