From: Nicolas Boisselier Date: Mon, 17 Oct 2016 13:39:30 +0000 (+0100) Subject: out::csv no more enclose X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=10693de6b7b72a995706eab83a82506f071786e3;p=nb.git out::csv no more enclose --- diff --git a/lib/php/out.php b/lib/php/out.php index ff1a806d..aa8e60c4 100644 --- a/lib/php/out.php +++ b/lib/php/out.php @@ -111,7 +111,7 @@ Class Out extends Nb { 'csv' => array( 'sep' => self::p('sep',"\t"), 'eol' => self::p('eol',"\n"), - 'enclose' => array("","\n"), +# NB 17.10.16 'enclose' => ["","\n"], ), 'yaml' => [ @@ -357,7 +357,7 @@ Class Out extends Nb { foreach (array_keys(self::$types) as $t) { if (preg_match("@^\w+/$t@",self::client_header('Accept'))) return $t; } - return; + #return; } /* @@ -444,7 +444,11 @@ Class Out extends Nb { } public static function head_csv(&$o,&$row) { - if (!is_array($row)) echo 0; + if (!is_array($row)) { + echo 0; + return 0; + } + if (self::is_hash($row)) { $ar = array_keys($row); return self::row_csv($o,$ar);