]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/mime.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 7 Feb 2018 20:15:58 +0000 (20:15 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 7 Feb 2018 20:15:58 +0000 (20:15 +0000)
lib/postgres/mime.sql
www/dbq/dbq.php

index d9a1fdb351a4649739383b648323ab4aebe539c1..48463ed5a4e624865980a58ba7fc44fd4e164a4f 100644 (file)
@@ -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,<td>,\t,g" \
 | sed -E -e "s/ *<br[^>]*> */,/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;
index fdd64913b4ad527609c1f560ee8c395b485e888a..8519e4f01da724ea9fb417ae7237e33bc4bd83a2 100644 (file)
@@ -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) {