From 7a81849b54498af037781d48b6e676cb126b773c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 20 Dec 2016 12:25:10 +0000 Subject: [PATCH] dbq --- lib/php/db/table.php | 2 -- lib/php/out.php | 26 +++++--------------------- lib/php/page.php | 4 ++++ 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index ede96045..7ee5614d 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -912,8 +912,6 @@ Class Table extends nb { foreach ($this->db()->fields($st) as $f) { $fields[$f->name] = $f; } $this->fields = $fields; } - #debug($fields); - #bye($this->name); # # Fields filter diff --git a/lib/php/out.php b/lib/php/out.php index 7650ad75..ff81ce9d 100644 --- a/lib/php/out.php +++ b/lib/php/out.php @@ -101,10 +101,6 @@ Class Out extends Nb { ), 'php' => array( -# NB 27.09.16 'enclose' => [ -# NB 27.09.16 ''.NB_EOL -# NB 27.09.16 ], 'enclose' => (self::p('enclose') === '0' ? [] : [ ''.NB_EOL @@ -112,17 +108,6 @@ Class Out extends Nb { 'eol' => self::p('eol',NB_EOL), 'rec' => ',', 'row' => function(&$o,&$r) { -#bye($o['var_export']); -/* - if (!empty($o['var_export'])) { - if (empty($_GLOBAL['ROWS'])) { - $_GLOBAL['ROWS'] = []; - $o['rec'] = ''; - } - $_GLOBAL['ROWS'][] = $r; - return; - } - */ return var_export($r); echo preg_replace(array( '/(=>\s*)\n\s+/m', @@ -133,9 +118,9 @@ Class Out extends Nb { ),var_export($r,true)); } ), - 'php_var_dump' => array( 'row' => function(&$o,&$r) {var_dump($r);},), - 'php_print_r' => array( 'row' => function(&$o,&$r) {print_r($r);},), - 'php_var_export' => array( 'row' => function(&$o,&$r) {var_export($r);},), + 'php_var_dump' => ['row' => function(&$o,&$r) {var_dump($r);},], + 'php_print_r' => ['row' => function(&$o,&$r) {print_r($r);},], + 'php_var_export' => ['row' => function(&$o,&$r) {var_export($r);},], 'div' => array( 'is_html' => true, @@ -189,7 +174,6 @@ Class Out extends Nb { 'quote' => self::p('quote',''), 'quote_escape' => self::punescape('quote_escape','\\'), 'eol' => self::punescape('eol',"\n"), -# NB 17.10.16 'enclose' => ["","\n"], ), 'yaml' => [ @@ -202,7 +186,6 @@ Class Out extends Nb { ], 'json' => array( - #'enclose' => array('['.NB_EOL,NB_EOL.']'), 'enclose' => array('['.self::p('eol',NB_EOL),']'), 'row' => function(&$o,&$row) { return json_encode($row); }, 'eol' => self::p('eol',NB_EOL), @@ -355,10 +338,11 @@ Class Out extends Nb { # Assume html/xml tag style } elseif (isset($o['tag'])) { $ret = out_tag($o,$row); - } else { + } else { # txt $ret = self::row_txt($o,$row); + } if (isset($o['eol'])) echo $o['eol']; diff --git a/lib/php/page.php b/lib/php/page.php index 49efa096..9d93c2e2 100644 --- a/lib/php/page.php +++ b/lib/php/page.php @@ -191,6 +191,7 @@ class Page extends nb { #bye('zaza'); static $is_html = null; if ($is_html === null) $is_html = preg_match('/ml$/',self::content_type()) ? true : false; + #bye((int)$is_html); # Extract attrs from tag if (preg_match('/^([\w-]+)\s+(.*?)$/',$tag,$m)) { @@ -208,6 +209,8 @@ class Page extends nb { # NB 28.11.16: Proper Markdown yould be great ! #if (!$is_html) return (preg_match('/^(span|a|inline|label|input|select)$/',strtolower($tag))?"":"\n").join("\n",(array)$content); // Markdonw to html + if (!$is_html) return join("\n",(array)$content); + /* if (!$is_html) return join("\n",array_map(function($e) use($tag){ if (preg_match('/^(li|dd)$/',$tag)) { @@ -229,6 +232,7 @@ class Page extends nb { ; },(array)$content)); + */ if ($content===null) { self::tag_end($tag); -- 2.47.3