From 618523f69baf6777b419b40c356075a57ded76bf Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 7 Feb 2018 20:15:58 +0000 Subject: [PATCH] lib/postgres/mime.sql --- lib/postgres/mime.sql | 8 +++++++- www/dbq/dbq.php | 5 ----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/postgres/mime.sql b/lib/postgres/mime.sql index d9a1fdb3..48463ed5 100644 --- a/lib/postgres/mime.sql +++ b/lib/postgres/mime.sql @@ -1,3 +1,5 @@ +-- NB 07.02.18: TODO http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + DROP TABLE IF EXISTS mime; CREATE TABLE IF NOT EXISTS mime ( ext varchar(12), @@ -710,7 +712,7 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Comp | sed "s,,\t,g" \ | sed -E -e "s/ *]*> */,/g" -e "s/,[^\t]+//" -e "s, *<[^>]+> *,,g" -e "s/^[\t ]*//" -e "s/([^\t]+)\t([^\t]+)$/\2\t\1/" \ | perl -pe "0 and /^([^\t]+,[^\t]+)/ and @_=split(qq|,|,\$_) and s/^[^\t]+/join(qq|,|,sort {length(\$b)<=>length(\$a)} @_)/e" \ -| sed -e "s/^\.//" +| sed -e "s/^\.//" \ ' WITH (format 'text', NULL ''); INSERT INTO mime SELECT * FROM tmp_mime ON CONFLICT DO NOTHING; @@ -721,6 +723,10 @@ https://gist.githubusercontent.com/electerious/3d5a31a73cfd6423f835c074ab25fc06/ ' WITH (format 'text', NULL ''); INSERT INTO mime SELECT * FROM tmp_mime ON CONFLICT DO NOTHING; +DELETE FROM tmp_mime; +COPY tmp_mime FROM PROGRAM 'curl -s http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | egrep "^\w"| sed -E "s/^([^\t ]+)[\t ]+([^\t ]+)/\2\t\1/"' WITH (format 'text', NULL ''); +INSERT INTO mime SELECT * FROM tmp_mime ON CONFLICT DO NOTHING; + -- DELETE FROM mime WHERE LENGTH(ext)>6; UPDATE mime AS m1 SET name=(SELECT name FROM mime AS m2 WHERE m2.name<>'' AND m2.type=m1.type ORDER BY name LIMIT 1) WHERE COALESCE(name,'')=''; COMMIT; diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index fdd64913..8519e4f0 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -221,8 +221,6 @@ class DbQ extends nb { } $rows = $ldap->search($GLOBALS['DBQ_LDAP'] + $search); - #echo $rows[0]['jpegPhoto']; exit; - #$rows = [ 'jpegPhoto' => $rows[0]['jpegPhoto'] ]; if ($this->is_html or ($this->params['format'] == $this->format_cli) or ($this->params['format'] == 'csv') @@ -508,12 +506,10 @@ class DbQ extends nb { ) ? [ 'row_parse_pre' => function(&$r){ $this->row_parse_pre($r); - $GLOBALS['dbq_args'] = urlencode( join($this->param_args_sep,$this->table->fields_keys_values($r)) ); }, 'row_parse_post' => function(&$r){ $this->row_parse_post($r); - $args = $GLOBALS['dbq_args']; $hidden = $this->form_hidden($r); $r = $this->ar_unshift($r,'view','' @@ -544,7 +540,6 @@ class DbQ extends nb { $this->db()->__construct($opt); $this->table->rows(); - unset($GLOBALS['dbq_args']); } private function ar_unshift( array & $array, $key, $val) { -- 2.47.3