Read local SVN repository in PHP
I have a subversion repository under /var/svn/ I am trying to use subversion to get details of the latest revision, I have tried using shell_exec to run svn info on the external address, but开发者_如何学编程 I couldn't get any input from it. Is there any way I can read the information from the repository itself?
Solved: Decided to go with the SVN PECL modudle see here
PHP has native support for SVN
(PECL though and not available on Windows)
You can also use the Arbit's VCS Abstraction Layer
(supports SVN, CVS, GIT, Mercurial and Archive)
Have you looked into PHP's SVN extension?
http://www.php.net/manual/en/book.svn.php
Resist the urge to write this yourself and go with a nicely constructed and maintained package like websvn that shows you all your repositories via a web interface, including full revision history on each file and directory within the repository. See a demo here
This will give you all the info on the history of the repository and should best answer your question.
Perhaps you could use a PHP svn library. I found this on google:
http://www.phpclasses.org/package/4270-PHP-Retrieve-files-from-an-SVN-repository-in-pure-PHP.html
FWIW, I'm using svn log and svn cat in PHP without any problems (except for a charset issue). I basically wrap the command in shell_exec.
HTH.
精彩评论