Annotation of parser3/bin/auto.p.dist.in, revision 1.21
1.21 ! moko 1: #$Id: auto.p.dist.in,v 1.20 2018/01/11 16:18:38 moko Exp $
1.1 paf 2:
1.11 paf 3: @conf[filespec]
4: $confdir[^file:dirname[$filespec]]
5: $charsetsdir[$confdir/charsets]
6: $sqldriversdir[$confdir/lib]
1.1 paf 7:
8: $CHARSETS[
1.16 moko 9: # $.cp866[$charsetsdir/cp866.cfg]
10: # $.koi8-r[$charsetsdir/koi8-r.cfg]
11: # $.koi8-u[$charsetsdir/koi8-u.cfg]
12: # $.windows-1250[$charsetsdir/windows-1250.cfg]
1.17 moko 13: # $.windows-1251[$charsetsdir/windows-1251.cfg]
1.16 moko 14: # $.windows-1254[$charsetsdir/windows-1254.cfg]
15: # $.windows-1257[$charsetsdir/windows-1257.cfg]
16: # $.x-mac-cyrillic[$charsetsdir/x-mac-cyrillic.cfg]
1.1 paf 17: ]
1.15 moko 18:
1.9 paf 19: #change your client libraries paths to those on your system
1.1 paf 20: $SQL[
1.13 misha 21: $.drivers[^table::create{protocol driver client
1.15 moko 22: mysql $sqldriversdir/libparser3mysql.@dll_extension@ libmysqlclient.@dll_extension@
1.20 moko 23: #sqlite $sqldriversdir/libparser3sqlite.@dll_extension@ libsqlite3.@dll_extension@
1.18 moko 24: #pgsql $sqldriversdir/libparser3pgsql.@dll_extension@ libpq.@dll_extension@
1.15 moko 25: #oracle $sqldriversdir/libparser3oracle.@dll_extension@ libclntsh.@dll_extension@
1.1 paf 26: }]
27: ]
28:
1.13 misha 29: #for ^file::load[name;user-name] mime-type autodetection
30: $MIME-TYPES[^table::create{ext mime-type
1.19 misha 31: 7z application/x-7z-compressed
32: avi video/x-msvideo
1.21 ! moko 33: bmp image/bmp
1.19 misha 34: css text/css
35: cvs text/csv
1.1 paf 36: doc application/msword
1.19 misha 37: docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
38: dtd application/xml-dtd
1.1 paf 39: gif image/gif
1.19 misha 40: gz application/x-gzip
41: htm text/html
42: html text/html
43: ico image/x-icon
44: jpeg image/jpeg
1.1 paf 45: jpg image/jpeg
1.19 misha 46: js application/javascript
1.21 ! moko 47: json application/json
1.19 misha 48: log text/plain
49: mov video/quicktime
1.1 paf 50: mp3 audio/mpeg
1.21 ! moko 51: mp4 video/mp4
1.19 misha 52: mpg video/mpeg
53: mpeg video/mpeg
54: mts application/metastream
1.21 ! moko 55: otf font/otf
1.19 misha 56: pdf application/pdf
57: png image/png
58: ppt application/powerpoint
1.21 ! moko 59: rar application/vnd.rar
1.19 misha 60: rdf application/rdf+xml
61: rss application/rss+xml
62: rtf application/rtf
63: svg image/svg+xml
64: tar application/x-tar
65: tgz application/x-gzip
66: tif image/tiff
1.21 ! moko 67: tiff image/tiff
! 68: ttf font/ttf
1.19 misha 69: txt text/plain
1.1 paf 70: wav audio/x-wav
1.19 misha 71: xls application/vnd.ms-excel
72: xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
73: xml text/xml
74: xsl text/xml
1.21 ! moko 75: webm video/webm
! 76: webp image/webp
! 77: woff font/woff
! 78: woff2 font/woff2
1.19 misha 79: zip application/zip
1.1 paf 80: }]
81:
82: $LIMITS[
83: $.post_max_size(10*0x400*0x400)
1.19 misha 84: ]
1.1 paf 85:
86: #$MAIL[
87: # $.sendmail[your sendmail command goes here]
88: # these are tried when no 'sendmail' specified:
1.13 misha 89: # /usr/sbin/sendmail -t -i -f postmaster
90: # /usr/lib/sendmail -t -i -f postmaster
1.1 paf 91: #]
92:
1.13 misha 93:
1.10 paf 94: @fatal_error[title;subtitle;body]
1.6 paf 95: $response:status(500)
96: $response:content-type[
1.13 misha 97: $.value[text/html]
98: $.charset[$response:charset]
1.1 paf 99: ]
1.6 paf 100: <html>
101: <head><title>$title</title></head>
102: <body>
1.10 paf 103: <h1>^if(def $subtitle){$subtitle;$title}</h1>
1.6 paf 104: $body
105: #for [x] MSIE friendly
106: ^for[i](0;512/8){<!-- -->}
107: </body>
1.10 paf 108: </html>
1.1 paf 109:
1.13 misha 110:
1.3 paf 111: @unhandled_exception_debug[exception;stack]
1.10 paf 112: ^fatal_error[Unhandled Exception^if(def $exception.type){ ($exception.type)};$exception.source;
1.1 paf 113: <pre>^untaint[html]{$exception.comment}</pre>
1.10 paf 114: ^if(def $exception.file){
1.13 misha 115: ^untaint[html]{<tt>$exception.file^(${exception.lineno}:$exception.colno^)</tt>}
1.1 paf 116: }
117: ^if($stack){
1.10 paf 118: <hr/>
119: <table>
1.1 paf 120: ^stack.menu{
1.10 paf 121: <tr><td>$stack.name</td><td><tt>$stack.file^(${stack.lineno}:$stack.colno^)</tt></td></tr>
1.1 paf 122: }
1.10 paf 123: </table>
1.1 paf 124: }
1.3 paf 125: ]
126:
1.13 misha 127:
1.6 paf 128: @unhandled_exception_release[exception;stack]
1.10 paf 129: ^fatal_error[Unhandled Exception;;
1.6 paf 130:
1.13 misha 131: <p>The server encountered an unhandled exception and was unable to complete your request.</p>
132: <p>Please contact the server administrator, $env:SERVER_ADMIN and inform them of the time the error occurred, and anything you might have done that may have caused the error.</p>
133: <p>More information about this error may be available in the Parser error log or in debug version of unhandled_exception.</p>
1.6 paf 134:
1.3 paf 135: ]
1.6 paf 136:
1.13 misha 137:
1.12 paf 138: @is_developer[]
139: #change mask to your ip address
1.13 misha 140: $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$])
141:
1.12 paf 142:
1.6 paf 143: @unhandled_exception[exception;stack]
1.12 paf 144: #developer? use debug version to see problem details
1.13 misha 145: ^if(^is_developer[]){
146: ^unhandled_exception_debug[$exception;$stack]
1.12 paf 147: }{
1.13 misha 148: ^if($exception.type eq "file.missing"){
149: # ^log404[]
150: # ^location[/404/]
151: $response:status(404)
152: }{
153: ^unhandled_exception_release[$exception;$stack]
154: }
1.12 paf 155: }
1.6 paf 156:
1.1 paf 157:
158: @auto[]
159: #source/client charsets
1.15 moko 160: $request:charset[utf-8]
161: $response:charset[utf-8]
1.1 paf 162:
163: $response:content-type[
1.13 misha 164: $.value[text/html]
165: $.charset[$response:charset]
1.1 paf 166: ]
167:
1.15 moko 168: #$SQL.connect-string[mysql://user:pass@host/db?charset=utf8]
169: #$SQL.connect-string[sqlite://db]
1.1 paf 170: #$SQL.connect-string[pgsql://user:pass@host/db]
171: #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password]
E-mail: