]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 20 Nov 2017 03:35:08 +0000 (03:35 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 20 Nov 2017 03:35:08 +0000 (03:35 +0000)
lib/php/nb.php
www/dbq/dbq.php

index 6f2bd03b99604488f91674f93408a872a8708e9b..0868fbced32f797a939746e0525a1624ddcf2e8d 100644 (file)
@@ -425,6 +425,9 @@ class NB {
     $_benchmark[$function] = microtime(true);
   }
 
+  public static function json_decode($v) { return json_decode($v); }
+  public static function json_encode($v) { return json_encode($v); }
+
   /*
    * Function: object2array
    */
index caac82edc69f9ac97aef04dedb4b5a5c72db91dc..5fa86d8e8eb22754d7af430b262e3e499f8c4af8 100644 (file)
@@ -649,6 +649,24 @@ EOF;
     $this->is_html = strpos($content_type,'html') ? true : false;
     $this->db->is_html = $this->is_html;
 
+    #if ( $format == 'json' and isset($_GET['json']) ) {
+    #bye($this->p('json'));
+    /*
+    if ( $format == 'json' and isset($_POST['json']) ) {
+      #bye($_POST['json']);
+      #$this->pset($this->json_decode($_POST['json']));
+      $_POST = $this->json_decode($_POST['json']);
+      #bye($this->p());
+    }
+
+    if ( $format == 'json' and $this->p('json') ) {
+      #bye($this->p('json'));
+      #bye($this->json_decode($this->p('json')));
+      #bye($this->json_decode('{"id": "2"}'));
+      $this->pset($this->json_decode($this->p('json')));
+    }
+     */
+
   }
 
   public function phpinfo_rows() {