From: Nico Boisselier Date: Thu, 27 Oct 2016 09:40:30 +0000 (+0100) Subject: db.stdin X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=21fa7532b7dab6e52fad81d8ce5daeff669b9000;p=nb.git db.stdin --- diff --git a/etc/vim/source/functions.vim b/etc/vim/source/functions.vim index 8be28cc0..526cd40f 100644 --- a/etc/vim/source/functions.vim +++ b/etc/vim/source/functions.vim @@ -106,7 +106,7 @@ func! FileInit(...) let g:File['check'] = 'du -sh' if (g:File['type'] == 'php') - let g:File['check'] = "php5 --define error_reporting=22519 --define display_errors=1 --define log_errors=1 --define html_errors=0" " E_ALL & ~E_NOTICE & ~E_DEPRECATED + let g:File['check'] = "php --define error_reporting=22519 --define display_errors=1 --define log_errors=1 --define html_errors=0" " E_ALL & ~E_NOTICE & ~E_DEPRECATED " todo - NB 11.12.12 if match(expand('%'),'/izideal/') let g:File['check'] = g:File['check'] . ' -z ~izideal/include/default.inc.php' elseif (g:File['type'] == 'python') diff --git a/lib/php/db.php b/lib/php/db.php index 1faf9153..1d91767a 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -510,6 +510,18 @@ class Db extends nb { $this->out($available,['action','description']); $return = true; + } elseif ($action == 'db.stdin') { + + $count = 0; + while ($line = fgets(STDIN)) { + $count++; + #echo "$count> $line"; + $this->conn->exec($line); + } + $return = $this->out([ + 'count' => $count, + ]); + } elseif ($action == 'db.tables' or $action == 'tables') { # Filters $type = $this->p('type','');