|
Posted by Erwin Moller on 11/15/59 11:24
Papa.Legba.666@gmail.com wrote:
> I use a PHP based blog system and am considering writing some offline
> tools.
>
> Does anyone know of a C++ class or function which can un/serialze()
> data compatibly with PHP ?
>
> Thanks in advance...
Hi,
I am quite unexperienced with C++, but can the PHP sourcefiles help you?
Download them at www.php.net.
unpack.
You'll find files like this:
../php-5.0.4/ext/standard/tests/serialize
../php-5.0.4/ext/standard/var_unserializer.re
../php-5.0.4/ext/standard/var_unserializer.c
../php-5.0.4/ext/standard/var_unserializer.c.orig
They contain a lot of C-code that might be of help. :-)
Here is a small piece.
They all start with including other files, you maybe you have puzzle a bit
to satify dependencies...
Maybe not. What do I know of C?
Regards,
Erwin Moller
---------------------------
/* $Id: var_unserializer.c,v 1.38.2.13 2005/03/10 01:58:13 helly Exp $ */
#include "php.h"
#include "ext/standard/php_var.h"
#include "php_incomplete_class.h"
/* {{{ reference-handling for unserializer: var_* */
#define VAR_ENTRIES_MAX 1024
typedef struct {
zval *data[VAR_ENTRIES_MAX];
long used_slots;
void *next;
} var_entries;
static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval)
{
etc
-------------------------
Navigation:
[Reply to this message]
|