Annotation of parser3/bin/auto.p.dist.in, revision 1.19
1.19 ! misha 1: #$Id: auto.p.dist.in,v 1.18 2013/07/22 20:20:17 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@
23: #sqlite $sqldriversdir/libparser3sqlite.@dll_extension@ sqlite3.@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: au audio/basic
! 33: avi video/x-msvideo
! 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
! 47: log text/plain
1.1 paf 48: mid audio/midi
49: midi audio/midi
1.19 ! misha 50: mov video/quicktime
1.1 paf 51: mp3 audio/mpeg
1.19 ! misha 52: mpg video/mpeg
! 53: mpeg video/mpeg
! 54: mts application/metastream
! 55: pdf application/pdf
! 56: png image/png
! 57: ppt application/powerpoint
! 58: ra audio/x-realaudio
1.1 paf 59: ram audio/x-pn-realaudio
1.19 ! misha 60: rar application/x-rar-compressed
! 61: rdf application/rdf+xml
1.1 paf 62: rpm audio/x-pn-realaudio-plugin
1.19 ! misha 63: rss application/rss+xml
! 64: rtf application/rtf
! 65: svg image/svg+xml
! 66: swf application/x-shockwave-flash
! 67: tar application/x-tar
! 68: tgz application/x-gzip
! 69: tif image/tiff
! 70: txt text/plain
1.1 paf 71: wav audio/x-wav
1.19 ! misha 72: xls application/vnd.ms-excel
! 73: xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
! 74: xml text/xml
! 75: xsl text/xml
! 76: zip application/zip
1.1 paf 77: }]
78:
79: $LIMITS[
80: $.post_max_size(10*0x400*0x400)
1.19 ! misha 81: ]
1.1 paf 82:
83: #$MAIL[
84: # $.sendmail[your sendmail command goes here]
85: # these are tried when no 'sendmail' specified:
1.13 misha 86: # /usr/sbin/sendmail -t -i -f postmaster
87: # /usr/lib/sendmail -t -i -f postmaster
1.1 paf 88: #]
89:
1.13 misha 90:
1.10 paf 91: @fatal_error[title;subtitle;body]
1.6 paf 92: $response:status(500)
93: $response:content-type[
1.13 misha 94: $.value[text/html]
95: $.charset[$response:charset]
1.1 paf 96: ]
1.6 paf 97: <html>
98: <head><title>$title</title></head>
99: <body>
1.10 paf 100: <h1>^if(def $subtitle){$subtitle;$title}</h1>
1.6 paf 101: $body
102: #for [x] MSIE friendly
103: ^for[i](0;512/8){<!-- -->}
104: </body>
1.10 paf 105: </html>
1.1 paf 106:
1.13 misha 107:
1.3 paf 108: @unhandled_exception_debug[exception;stack]
1.10 paf 109: ^fatal_error[Unhandled Exception^if(def $exception.type){ ($exception.type)};$exception.source;
1.1 paf 110: <pre>^untaint[html]{$exception.comment}</pre>
1.10 paf 111: ^if(def $exception.file){
1.13 misha 112: ^untaint[html]{<tt>$exception.file^(${exception.lineno}:$exception.colno^)</tt>}
1.1 paf 113: }
114: ^if($stack){
1.10 paf 115: <hr/>
116: <table>
1.1 paf 117: ^stack.menu{
1.10 paf 118: <tr><td>$stack.name</td><td><tt>$stack.file^(${stack.lineno}:$stack.colno^)</tt></td></tr>
1.1 paf 119: }
1.10 paf 120: </table>
1.1 paf 121: }
1.3 paf 122: ]
123:
1.13 misha 124:
1.6 paf 125: @unhandled_exception_release[exception;stack]
1.10 paf 126: ^fatal_error[Unhandled Exception;;
1.6 paf 127:
1.13 misha 128: <p>The server encountered an unhandled exception and was unable to complete your request.</p>
129: <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>
130: <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 131:
1.3 paf 132: ]
1.6 paf 133:
1.13 misha 134:
1.12 paf 135: @is_developer[]
136: #change mask to your ip address
1.13 misha 137: $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$])
138:
1.12 paf 139:
1.6 paf 140: @unhandled_exception[exception;stack]
1.12 paf 141: #developer? use debug version to see problem details
1.13 misha 142: ^if(^is_developer[]){
143: ^unhandled_exception_debug[$exception;$stack]
1.12 paf 144: }{
1.13 misha 145: ^if($exception.type eq "file.missing"){
146: # ^log404[]
147: # ^location[/404/]
148: $response:status(404)
149: }{
150: ^unhandled_exception_release[$exception;$stack]
151: }
1.12 paf 152: }
1.6 paf 153:
1.1 paf 154:
155: @auto[]
156: #source/client charsets
1.15 moko 157: $request:charset[utf-8]
158: $response:charset[utf-8]
1.1 paf 159:
160: $response:content-type[
1.13 misha 161: $.value[text/html]
162: $.charset[$response:charset]
1.1 paf 163: ]
164:
1.15 moko 165: #$SQL.connect-string[mysql://user:pass@host/db?charset=utf8]
166: #$SQL.connect-string[sqlite://db]
1.1 paf 167: #$SQL.connect-string[pgsql://user:pass@host/db]
168: #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password]
E-mail: