Just for the sake of interest, been having a hack with Sara Golemon’s cvsclient extension. Being able to access CVS over HTTP (perhaps for a HTML forms interface for updates or exposing with XML-RPC / SOAP) is a very worthwhile aim IMO.
Note that cvsclient is beta (0.2) with only limited functionality so far, for reading a repository and examining the logs for a given file. There’s also next to zero documentation apart from the source.
If you’re running Linux and have the PEAR package manager set up, installing cvsclient as a shared library only requires type “pear install cvsclient-beta” then adding the .so file to your php.ini as an extension. If you’re on Windows… you probably need to beg the owner of this site.
Was able to connect to the WACT CVS repository at Sourceforge like;
$cvs_server = 'cvs.sf.net';
$cvs_root = '/cvsroot/wact';
if ( !$cvs = cvsclient_connect($cvs_server,$cvs_root) ) {
die('Could not connect');
}
echo "Connected to server\n";
$cvs_user = 'anonymous';
$cvs_pass = '';
if ( !cvsclient_login($cvs,$cvs_user,$cvs_pass) ) {
die ('Could not login');
}
echo "Logged in\n";
Two further functions are exposed to PHP, cvsclient_retrieve() and cvsclient_log(), the former seeming to iterate of the contents of directory in CVS while the latter can be used to fetch the log for a single file e.g.;
$module = 'wact';
$path = '.';
while ($file = cvsclient_retrieve($cvs,$module,$path) ) {
echo $file;
}
and
$file = 'README';
print_r (cvsclient_log($cvs,$module,$file));
Wasn’t able to access directories below the root of the WACT module – whether that’s my fault or a limitation in the current version, I’m not sure. Also there doesn’t seem to be a way to get the filename from cvsclient_retrieve() but. again, I may have missed the point.
Anyway – although it’s not something to put into production right now, it’s definately worth keeping an eye on. Wish the author good luck with it.
Related posts:
- How to Use PHP Namespaces, Part 3: Keywords and Autoloading In the final part of his series explaining PHP namespaces,...
- How to Use PHP Namespaces, Part 2: Importing, Aliases, and Name Resolution In the second part of Craig's PHP namespaces series, he...
- How to Install PHP on Windows In his final installation tutorial, Craig provides a step-by-step guide...
- Interactive CLI password prompt in PHP Just a quick tip, since I spent a good hour...
- How to Use PHP Namespaces, Part 1: The Basics In the first part of a series of articles, Craig...







While CVS is okay, why not subversion (http://subversion.tigris.org/)? WebDAV is much overlooked, and perhaps much under developed.
A PHP WebDAV client, now that is what I want.
May 5th, 2004 at 3:51 pm
That’s another interesting “angle of attack”. And there’s some good news…
http://pear.php.net/package/HTTP_WebDAV_Client
http://pear.php.net/package/HTTP_WebDAV_Server
The latest (April) PHP Mag (http://www.phpmag.net/) online edition has an article on them (PHP Mag usually puts the PEAR articles online at a later date).
I know Subversion has it’s own “plugin” for Apache for providing a WebDav server. So far not played with it (or Subversion) seriously though.
May 6th, 2004 at 3:38 pm
Don’t beg the wrong people for win32 binaries.
If you want a PECL extension under windows, ask on pecl-dev@lists.php.net.
The cvsclient extension is already built for PHP 5 (because the build system is sane) and is available from http://snaps.php.net/win32/PECL_5_0/php_cvsclient.dll
May 9th, 2004 at 5:00 pm
I am alse want to find a way to view the file by http_webdav_server class of pear.But I get errors. Why
December 17th, 2005 at 9:24 pm