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

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

E-mail: