Annotation of parser3/bin/auto.p.dist.in, revision 1.14
1.14 ! misha 1: #$Id: auto.p.dist.in,v 1.13 2006/09/11 15:05:53 misha 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[
9: @commentcharset_koi8r@ $.koi8-r[$charsetsdir/koi8-r.cfg]
10: @commentcharset_windows1250@ $.windows-1250[$charsetsdir/windows-1250.cfg]
11: @commentcharset_windows1251@ $.windows-1251[$charsetsdir/windows-1251.cfg]
12: @commentcharset_windows1257@ $.windows-1257[$charsetsdir/windows-1257.cfg]
13: ]
1.9 paf 14: #change your client libraries paths to those on your system
1.1 paf 15: $SQL[
1.13 misha 16: $.drivers[^table::create{protocol driver client
1.8 paf 17: mysql $sqldriversdir/libparser3mysql.@dll_extension@ @mysql_client@
18: pgsql $sqldriversdir/libparser3pgsql.@dll_extension@ @pgsql_client@
19: oracle $sqldriversdir/libparser3oracle.@dll_extension@ @oracle_client@
1.14 ! misha 20: sqlite $sqldriversdir/libparser3sqlite.@dll_extension@ @sqlite_client@
1.1 paf 21: }]
22: ]
23:
1.13 misha 24: #for ^file::load[name;user-name] mime-type autodetection
25: $MIME-TYPES[^table::create{ext mime-type
1.1 paf 26: zip application/zip
27: doc application/msword
28: xls application/vnd.ms-excel
29: pdf application/pdf
30: ppt application/powerpoint
31: rtf application/rtf
32: gif image/gif
33: jpg image/jpeg
1.4 paf 34: jpeg image/jpeg
1.1 paf 35: png image/png
36: tif image/tiff
37: html text/html
38: htm text/html
39: txt text/plain
1.7 paf 40: xml text/xml
1.1 paf 41: mts application/metastream
42: mid audio/midi
43: midi audio/midi
44: mp3 audio/mpeg
45: ram audio/x-pn-realaudio
46: rpm audio/x-pn-realaudio-plugin
47: ra audio/x-realaudio
48: wav audio/x-wav
49: au audio/basic
50: mpg video/mpeg
51: avi video/x-msvideo
52: mov video/quicktime
53: swf application/x-shockwave-flash
54: }]
55:
56: $LIMITS[
57: $.post_max_size(10*0x400*0x400)
58: ]
59:
60: #$MAIL[
61: # $.sendmail[your sendmail command goes here]
62: # these are tried when no 'sendmail' specified:
1.13 misha 63: # /usr/sbin/sendmail -t -i -f postmaster
64: # /usr/lib/sendmail -t -i -f postmaster
1.1 paf 65: #]
66:
1.13 misha 67:
1.10 paf 68: @fatal_error[title;subtitle;body]
1.6 paf 69: $response:status(500)
70: $response:content-type[
1.13 misha 71: $.value[text/html]
72: $.charset[$response:charset]
1.1 paf 73: ]
1.6 paf 74: <html>
75: <head><title>$title</title></head>
76: <body>
1.10 paf 77: <h1>^if(def $subtitle){$subtitle;$title}</h1>
1.6 paf 78: $body
79: #for [x] MSIE friendly
80: ^for[i](0;512/8){<!-- -->}
81: </body>
1.10 paf 82: </html>
1.1 paf 83:
1.13 misha 84:
1.3 paf 85: @unhandled_exception_debug[exception;stack]
1.10 paf 86: ^fatal_error[Unhandled Exception^if(def $exception.type){ ($exception.type)};$exception.source;
1.1 paf 87: <pre>^untaint[html]{$exception.comment}</pre>
1.10 paf 88: ^if(def $exception.file){
1.13 misha 89: ^untaint[html]{<tt>$exception.file^(${exception.lineno}:$exception.colno^)</tt>}
1.1 paf 90: }
91: ^if($stack){
1.10 paf 92: <hr/>
93: <table>
1.1 paf 94: ^stack.menu{
1.10 paf 95: <tr><td>$stack.name</td><td><tt>$stack.file^(${stack.lineno}:$stack.colno^)</tt></td></tr>
1.1 paf 96: }
1.10 paf 97: </table>
1.1 paf 98: }
1.3 paf 99: ]
100:
1.13 misha 101:
1.6 paf 102: @unhandled_exception_release[exception;stack]
1.10 paf 103: ^fatal_error[Unhandled Exception;;
1.6 paf 104:
1.13 misha 105: <p>The server encountered an unhandled exception and was unable to complete your request.</p>
106: <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>
107: <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 108:
1.3 paf 109: ]
1.6 paf 110:
1.13 misha 111:
1.12 paf 112: @is_developer[]
113: #change mask to your ip address
1.13 misha 114: $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$])
115:
1.12 paf 116:
1.6 paf 117: @unhandled_exception[exception;stack]
1.12 paf 118: #developer? use debug version to see problem details
1.13 misha 119: ^if(^is_developer[]){
120: ^unhandled_exception_debug[$exception;$stack]
1.12 paf 121: }{
1.13 misha 122: ^if($exception.type eq "file.missing"){
123: # ^log404[]
124: # ^location[/404/]
125: $response:status(404)
126: }{
127: ^unhandled_exception_release[$exception;$stack]
128: }
1.12 paf 129: }
1.6 paf 130:
1.1 paf 131:
132: @auto[]
133: #source/client charsets
134: $request:charset[windows-1251]
135: $response:charset[windows-1251]
136:
137: $response:content-type[
1.13 misha 138: $.value[text/html]
139: $.charset[$response:charset]
1.1 paf 140: ]
141:
142: #$SQL.connect-string[mysql://user:pass@host/db?charset=cp1251_koi8]
143: #$SQL.connect-string[pgsql://user:pass@host/db]
144: #$SQL.connect-string[oracle://user:pass@service?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
145: #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password]
1.14 ! misha 146: #$SQL.connect-string[sqlite://db]
E-mail: