[Cdash] database support in cdash

Markus Grabner grabner at icg.tugraz.at
Tue May 20 16:26:31 EDT 2008


Am Dienstag, 22. April 2008 17:39 schrieben Sie:
> Markus Grabner wrote:
> > Am Dienstag, 22. April 2008 17:25 schrieb Julien Jomier:
> >> Markus Grabner wrote:
> >>> Am Dienstag, 22. April 2008 17:11 schrieb Julien Jomier:
> >>>>>> I'm going to
> >>>>>> give it a try when I get a chance. If it works well, it might be
> >>>>>> available soon.
> >>>>>
> >>>>> Ok, please let me know when you proceed with that. I'm also willing
> >>>>> to help if I can. So far, however, I only used the mysql_ functions
> >>>>> and the Pear DB classes, but PDO should not be too different I guess.
> >>>>
> >>>> The plan is to tag and release CDash 1.0 early next week. Then it will
> >>>> be my first priority.
> >>>
> >>> Ok, great! So the trunk will then become the "inofficial version 1.1"
> >>> until version 1.2 is finished, or will there be a separate branch for
> >>> the PDO stuff?
> >>
> >> It would be the "unofficial version 1.1" so you would be able to test it
> >> from SVN. We just create branches for releases.
> >
> > Ok, then I will stay tuned and see how it evolves (and if I can maybe
> > contribute somewhere).
>
> Thanks a lot Markus. I'll definitely keep you in the loop.
I just did a quick hack to add an additional layer between the CDash code and 
the database. It works as follows:

*) There is a file "pdo.php" which contains "pdo_*()" counterparts of 
all "mysql_*()" functions used by CDash.

*) If "$CDASH_DB_TYPE" is defined, calls to "pdo_*()" are routed to the 
corresponding PDO member functions.

*) If "$CDASH_DB_TYPE" is undefined, calls to "pdo_*()" are routed directly 
back to their "mysql_*()" counterparts. This is for backward compatibility, 
should PDO not be available.

*) The script "transform.sh" replaces all occurences of "mysql_" in the PHP 
code by "pdo_" and modifies "config.php" accordingly. *NOTE*: it does a 
recursive "svn revert" before, so any uncommited changes will be undone. 
Please commit before trying it!

I set up a "toy project" and was able to browse the CDash pages using the 
PDO_MYSQL driver. It is far from complete and requires some extra work to 
support other databases (replace MySQL-specific code), but I think it's a 
useful proof of concept and doesn't require dramatic changes to the code base 
right now (a clean solution would certainly be to "inline" all the "pdo_*()" 
function calls, but that's a different - and much more tedious - story).

What do you think about it?

	Kind regards,
		Markus


-- 
Markus Grabner - Computer Graphics and Vision
Graz University of Technology, Inffeldgasse 16a/II, 8010 Graz, Austria
Phone: +43/316/873-5041, Fax: +43/316/873-5050
WWW: http://www.icg.tugraz.at/Members/grabner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdo.php
Type: application/x-php
Size: 3973 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cdash/attachments/20080520/d011a01a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform.sh
Type: application/x-shellscript
Size: 233 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cdash/attachments/20080520/d011a01a/attachment-0001.bin>


More information about the Cdash mailing list