diff options
Diffstat (limited to 'poc/poc02-compiling-cake/src/php-weave/json_serialiser.class.php')
-rw-r--r-- | poc/poc02-compiling-cake/src/php-weave/json_serialiser.class.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/poc/poc02-compiling-cake/src/php-weave/json_serialiser.class.php b/poc/poc02-compiling-cake/src/php-weave/json_serialiser.class.php new file mode 100644 index 0000000..40f55ce --- /dev/null +++ b/poc/poc02-compiling-cake/src/php-weave/json_serialiser.class.php @@ -0,0 +1,12 @@ +<?php +require_once '../vendor/nikic/php-parser/lib/bootstrap.php'; + +class PHPParser_JSONSerialiser implements PHPParser_Serializer,PHPParser_Unserializer { + public function serialize(array $nodes) { + //FIXME : gros problème, ça n'encode pas les objects !!! + return json_encode($nodes); + } + public function unserialize($string) { + return json_decode($string); + } +} |