I'm maintaining the PDFlib wrapper code for the "pdf" extenions of
PHP. I did a major rewrite of the wrapper for PDFlib 6 and PHP 5 and
wanted to ask whether it is good idea to check in this code now (short
before the release of PHP 5).
My idea is to add this new Wrappercode as an extra module and keep
the existing wrapper code for peoples using the old PDFlib 4 version.
This is necessary because there are incompatible changes between
PDFlib 4 and 5 which made a new wrapper module necessary. Here the
details about the new wrapper code:
This PDFlib Wrapper Code works with PDFlib 5 and higher.
A new module was introduced, as PDFlib 5 supports a method to
handle the special returnvalues needed for PHP in the PDFlib core now.
This is necessary, as the new concept of optionlists in PDFlib allows
to pass handles to PDFlib objects and filenames inside of optionlists.
Before the wrapper added some offset to handles returned by PDFlib
to fit into scheme used by php to return 0 in case of errors, whereas
in PDFlib the errorcode is -1 and "0" is a valid handle.
As the optionlist may contain filenames on various places the
VIRTUAL_DIR support and the CHECK_OPEN_BASEDIR checks implemented
in the wrapper will not work reliable too. So VIRTUAL_DIR support
and the CHECK_OPEN_BASEDIR checking is disabled here too, as it would
only work for some of the files used with PDFlib.
The main changes:
- only official PDFlib API's are included (exception pdf_open_memory_image)
- supports PDFlib 5 and PDFlib 6
- builds with older PHP Version too
(tested with PHP 4.1.0, 4.2.1, 4.3.0, and 5.0.0RC2.)
- adds an Object Oriented API to PDFlib (for PHP 5 only)
- uses PHP exceptions (for PHP 5 only)
- disables VIRTUAL_DIR support (use SerachPath instead)
- disables CHECK_OPEN_BASEDIR checks
- changed old API's with varargs to only accept all args now
I think it is worth to include this now, so that PHP5 comes with this
new code, but I wanted to discuss this first.
Rainer Schaaf firstname.lastname@example.org http://www.pdflib.com
Personalize PDF: PDFlib Personalization Server and Block plugin
_______PDFlib - a library for generating PDF on the fly________