|
From: Andrew C. <And...@So...> - 2003-10-29 20:20:21
|
I have a slightly different php file and have gotten the example to function
correctly.
1) I commented out the line
rlib_finalize($rlib);
2) I have another line at the end
rlib_free($rlib);
try and replace the last four lines with this code
// ~~~~~~~ BEGIN CODE SNIP ~~~~~~~~~~~
// rlib_finalize($r);
header(rlib_get_content_type($r));
rlib_spool($r);
rlib_free($r);
?>
// ~~~~~~~ END CODE SNIP ~~~~~~~~~~~
I am just diving into the formatting of information today.
Andrew
-----Original Message-----
From: rli...@li...
[mailto:rli...@li...]On Behalf Of John Buckman
Sent: Wednesday, October 29, 2003 2:56 PM
To: rli...@li...
Subject: [Rlib-users] debugging php rlib & other thoughts
I have rlib working on my linux system, with the C code, but not with
PHP.
I tried the PHP example, and also mimicking my working C code in PHP,
namely like this:
<?
error_reporting(E_ALL);
dl ("libr.so");
$r = rlib_init();
rlib_add_datasource_mysql($r, "local_mysql", "localhost", "root",
"xxxxx", "magnatune");
rlib_add_query_as($r, "local_mysql", "select * from visa;", "example");
rlib_add_report($r, "report.xml", "example");
rlib_set_output_format($r, "html");
rlib_execute($r);
rlib_finalize($r);
header(rlib_get_content_type($r));
rlib_spool($r);
?>
the trouble is that if I run up to rlib_execute the page displays
nothing, and apache's errorlog shows a few pid's exiting. I'm not
sure how to debug this any further. I know the library's loading,
because if I pass invalid params to, say, rlib_add_report, I get a
helpful error.
--
you'll not that:
rlib_add_query_as($r, "local_mysql", "select * from visa;", "example");
takes 4 params, not 3 as documented.
--
it would be *very* helpful to have a reports.xml included in the
distribution. Copying/pasting from the PDF loses the tab indentation,
but more seriously, all single quotes are turned into "smart quotes"
which cause XML parser errors.
--
it would be very handy to be able to give a filename to rlib_spool(r)
and have the output written there. That would let me have a big C
program which generated all my reports in one program, without needing
to repeatedly run a C program and shell out.
---
Any interest in Tcl bindings? It happens to be my language of choice
(though I do use PHP and Perl a lot too). I can probably make them
fairly easily.
--
can you provide an XML example of report breaks ? I can probably hack
at them for a few hours and make them work, but an example would be
great (just paste the section into an email response)
---
FYI, the C code is very clean, which is a nice suprise, and really
helped me understand how this worked.
-john
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Rlib-users mailing list
Rli...@li...
https://lists.sourceforge.net/lists/listinfo/rlib-users
|