Say I have a file in a SVN. How do I use PHP to check the file's revision number?
I see the SVN function list at http://www.php.net/manual/en/ref.svn.php but am not sure which one to use or the exact code to do it.
Thanks!
Say I have a file in a SVN. How do I use PHP to check the file's revision number?
I see the SVN function list at http://www.php.net/manual/en/ref.svn.php but am not sure which one to use or the exact code to do it.
Thanks!
You want svn_status.
Usage would be something like:
$status = svn_status('path/to/file');
$revision = $status[0]['cmt_rev'];
You definitely don't want to be using svn_blame, as that's a very expensive operation (it has to retrieve a lot of history for the file to figure out who changed what, and that means (slow) requests to the server).