Annotation of parser3/bin/auto.p.dist.in, revision 1.16

1.16    ! moko        1: #$Id: auto.p.dist.in,v 1.15 2012-06-09 08:25:35 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]
        !            13:        $.windows-1251[$charsetsdir/windows-1251.cfg]
        !            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@
                     24: #pgsql $sqldriversdir/libparser3pgsql.@dll_extension@  libpq.so.@dll_extension@
                     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.1       paf        31: zip    application/zip
                     32: doc    application/msword
                     33: xls    application/vnd.ms-excel
                     34: pdf    application/pdf
                     35: ppt    application/powerpoint
                     36: rtf    application/rtf
                     37: gif    image/gif
                     38: jpg    image/jpeg
1.4       paf        39: jpeg   image/jpeg
1.1       paf        40: png    image/png
                     41: tif    image/tiff
                     42: html   text/html
                     43: htm    text/html
                     44: txt    text/plain
1.7       paf        45: xml    text/xml
1.1       paf        46: mts    application/metastream
                     47: mid    audio/midi
                     48: midi   audio/midi
                     49: mp3    audio/mpeg
                     50: ram    audio/x-pn-realaudio
                     51: rpm    audio/x-pn-realaudio-plugin
                     52: ra     audio/x-realaudio
                     53: wav    audio/x-wav
                     54: au     audio/basic
                     55: mpg    video/mpeg
                     56: avi    video/x-msvideo
                     57: mov    video/quicktime
                     58: swf    application/x-shockwave-flash
                     59: }]
                     60: 
                     61: $LIMITS[
                     62:        $.post_max_size(10*0x400*0x400)
                     63: ]      
                     64: 
                     65: #$MAIL[
                     66: #      $.sendmail[your sendmail command goes here]
                     67: #      these are tried when no 'sendmail' specified:
1.13      misha      68: #              /usr/sbin/sendmail -t -i -f postmaster
                     69: #              /usr/lib/sendmail -t -i -f postmaster
1.1       paf        70: #]
                     71: 
1.13      misha      72: 
1.10      paf        73: @fatal_error[title;subtitle;body]
1.6       paf        74: $response:status(500)
                     75: $response:content-type[
1.13      misha      76:        $.value[text/html]
                     77:        $.charset[$response:charset]
1.1       paf        78: ]
1.6       paf        79: <html>
                     80: <head><title>$title</title></head>
                     81: <body>
1.10      paf        82: <h1>^if(def $subtitle){$subtitle;$title}</h1>
1.6       paf        83: $body
                     84: #for [x] MSIE friendly
                     85: ^for[i](0;512/8){<!-- -->}
                     86: </body>
1.10      paf        87: </html>
1.1       paf        88: 
1.13      misha      89: 
1.3       paf        90: @unhandled_exception_debug[exception;stack]
1.10      paf        91: ^fatal_error[Unhandled Exception^if(def $exception.type){ ($exception.type)};$exception.source;
1.1       paf        92: <pre>^untaint[html]{$exception.comment}</pre>
1.10      paf        93: ^if(def $exception.file){
1.13      misha      94:        ^untaint[html]{<tt>$exception.file^(${exception.lineno}:$exception.colno^)</tt>}
1.1       paf        95: }
                     96: ^if($stack){
1.10      paf        97:        <hr/>
                     98:        <table>
1.1       paf        99:        ^stack.menu{
1.10      paf       100:                <tr><td>$stack.name</td><td><tt>$stack.file^(${stack.lineno}:$stack.colno^)</tt></td></tr>
1.1       paf       101:        }
1.10      paf       102:        </table>
1.1       paf       103: }
1.3       paf       104: ]
                    105: 
1.13      misha     106: 
1.6       paf       107: @unhandled_exception_release[exception;stack]
1.10      paf       108: ^fatal_error[Unhandled Exception;;
1.6       paf       109: 
1.13      misha     110: <p>The server encountered an unhandled exception and was unable to complete your request.</p>
                    111: <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>
                    112: <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       113: 
1.3       paf       114: ]
1.6       paf       115: 
1.13      misha     116: 
1.12      paf       117: @is_developer[]
                    118: #change mask to your ip address
1.13      misha     119: $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$])
                    120: 
1.12      paf       121: 
1.6       paf       122: @unhandled_exception[exception;stack]
1.12      paf       123: #developer? use debug version to see problem details
1.13      misha     124: ^if(^is_developer[]){
                    125:        ^unhandled_exception_debug[$exception;$stack]
1.12      paf       126: }{
1.13      misha     127:        ^if($exception.type eq "file.missing"){
                    128: #              ^log404[]
                    129: #              ^location[/404/]
                    130:                $response:status(404)
                    131:        }{
                    132:                ^unhandled_exception_release[$exception;$stack]
                    133:        }
1.12      paf       134: }
1.6       paf       135: 
1.1       paf       136: 
                    137: @auto[]
                    138: #source/client charsets
1.15      moko      139: $request:charset[utf-8]
                    140: $response:charset[utf-8]
1.1       paf       141: 
                    142: $response:content-type[
1.13      misha     143:        $.value[text/html]
                    144:        $.charset[$response:charset]
1.1       paf       145: ]
                    146: 
1.15      moko      147: #$SQL.connect-string[mysql://user:pass@host/db?charset=utf8]
                    148: #$SQL.connect-string[sqlite://db]
1.1       paf       149: #$SQL.connect-string[pgsql://user:pass@host/db]
                    150: #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password]

E-mail: