summaryrefslogtreecommitdiff
path: root/poc/poc02-compiling-cake/src/php-weave/json_serialiser.class.php
diff options
context:
space:
mode:
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.php12
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);
+ }
+}