Annotation of parser3/www/htdocs/auto.p, revision 1.22.8.1

1.22.8.1! paf         1: @USE
        !             2: common/lib.p
        !             3: common/layout.p
        !             4: common/implode.p
        !             5: date/dtf.p
        !             6: mysql.p
        !             7: 
        !             8: 
        !             9: 
        !            10: #################################################################################################
        !            11: @auto[]
        !            12: # id объекта с 404 ошибкой:
        !            13: $MAIN:error404ObjectId(23)
        !            14: # id объекта, где лежат глобальные данные о сайте:
        !            15: $MAIN:siteDataObjectId(21)
        !            16: 
        !            17: # id корневого объекта раздела вопросы и ответы
        !            18: $MAIN:faq_category_root_id(3)
        !            19: 
        !            20: $MAIN:pSQL[^mysql::init[$SQL.connect-string;^if(^env:QUERY_STRING.pos[mode=debug] >= 0 || ^request:uri.pos[block_edit] >= 0){debug}]]
        !            21: 
        !            22: #^detectBrowser[]
        !            23: 
        !            24: # константа для новостей
        !            25: $MAIN:objIdNews(1)
        !            26: 
        !            27: # эта табличка нужна для очистки всякой фигни от ентитей/тегов
        !            28: $repl[^table::create{a b
        !            29: &nbsp^;         
        !            30: &hellip^;      ...
        !            31: &rdquo^;       "
        !            32: &ldquo^;       "
        !            33: &raquo^;       "
        !            34: &laquo^;       "
        !            35: &mdash^;       -
        !            36: &ndash^;       -
        !            37: &#8470^;       №
        !            38: &bull^;         }]
        !            39: #end @auto[]
        !            40: 
        !            41: 
        !            42: 
        !            43: #################################################################################################
        !            44: @unhandled_exceptionXXX[exception;stack][i;j]
        !            45: $response:content-type[
        !            46:        $.value[text/html]
        !            47:        $.charset[$response:charset]
        !            48: ]
        !            49: 
        !            50: <title>Server error.</title>
        !            51: <body bgcolor=white>
        !            52: <font color=black>
        !            53: <pre>В настоящее время на сервере проводятся регламентные работы. 
        !            54: Пожалуйста, зайдите позже.<br />
        !            55: Приносим наши извинения за возможные неудобства.<br />
        !            56: Если вы хотите оставить нам сообщение, пишите: <a href="mailto:mailbox@parser.ru">mailbox@parser.ru</a></pre>
        !            57: <!--
        !            58: comment:
        !            59: ^untaint{$exception.comment}
        !            60: ^if(def $exception.source){
        !            61:        source: $exception.source
        !            62:        file: ^untaint{$exception.file^($exception.lineno^)}
        !            63: }
        !            64: ^if(def $exception.type){type: exception.type=$exception.type}
        !            65: ^if($stack){
        !            66:        stack backtrace:
        !            67:        ^stack.menu{$stack.name $stack.file^($stack.lineno^)}[^#0A]
        !            68: }
        !            69: //-->
        !            70: #end
        !            71: 
        !            72: 
        !            73: 
        !            74: #################################################################################################
        !            75: @error404[][err_lang]
        !            76: ^location[/404/]
        !            77: #end @error404[]
        !            78: 
        !            79: 
        !            80: 
        !            81: #################################################################################################
        !            82: @pageHeader[header]
        !            83: $header
        !            84: #end @pageHeader[]
        !            85: 
        !            86: 
        !            87: 
        !            88: #################################################################################################
        !            89: @pageFooter[]
        !            90: footer
        !            91: #end @pageFooter[]
        !            92: 
        !            93: 
        !            94: 
        !            95: #################################################################################################
        !            96: @body[content]
        !            97: <body bgcolor="#F4F4F4" text="#000000" link="#0000C4" alink="#0000C4" vlink="#073683" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" onLoad="init()">
        !            98:        $content
        !            99: </body>
        !           100: #end @body[]
        !           101: 
        !           102: 
        !           103: 
        !           104: #################################################################################################
        !           105: @html[header;content]
        !           106: <!-- Copyright (c) Art. Lebedev Studio | http://www.design.ru/ -->
        !           107: <html>
        !           108: <head>
        !           109:        <base target="_top">
        !           110:        <link rel="stylesheet" type="text/css" href="/main.css"></link>
        !           111:        <title>AB.LV^if(def $header){ | ^taint[as-is][$header] }</title>
        !           112: </head>
        !           113: ^body{
        !           114:        <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#ffffff">
        !           115:        ^pageHeader[]
        !           116:        $content
        !           117:        ^pageFooter[]
        !           118:        </table>
        !           119: }
        !           120: <html>
        !           121: #end @html[]
        !           122: 
        !           123: 
        !           124: #################################################################################################
        !           125: @main[]
        !           126: ^pSQL.server{
        !           127:        <html>
        !           128:        <head>
        !           129:                ^if(def $prepare){^prepare[]}
        !           130:        </head>
        !           131:        ^body{^content[]}
        !           132:        </html>
        !           133: }
        !           134: # @main[]
        !           135: 
        !           136: 
        !           137: 
        !           138: #################################################################################################
        !           139: @postprocess[body][repl;tmp]
        !           140: ^if(def $body){
        !           141:        ^if($MAIN:browser eq "nn" && $MAIN:browser_ver < 5){
        !           142:                $repl[^table::create{a  b
        !           143: &hellip^;      &#133^;
        !           144: &rdquo^;       &#148^;
        !           145: &ldquo^;       &#147^;
        !           146: &mdash^;       &#151^;
        !           147: &ndash^;       &#150^;
        !           148: &bull^;        &#149^;}]
        !           149:                $result[^body.replace[$repl]]
        !           150:        }{
        !           151:                $result[$body]
        !           152:        }
        !           153:        $not_optimized_space[^taint[as-is][ ]]
        !           154:        $not_optimized_tab[^taint[as-is][^#09]]
        !           155:        $not_optimized_enter[^taint[as-is][^#0A]]
        !           156:        $result[^result.match[прОбЭл][g]{$not_optimized_space}]
        !           157:        $result[^result.match[тАб][g]{$not_optimized_tab}]
        !           158:        $result[^result.match[энтЕр][g]{$not_optimized_enter}]
        !           159: 
        !           160:        ^rem{ *** обрабатываем [parser]код[/parser] *** }
        !           161:        $result[^result.match[\[(parser)\](.+?)\[/\1\]][g]{^taint[as-is][^process{$match.2}]}]
        !           162: }{
        !           163:        $result[]
        !           164: }
        !           165: ^getStat[]
        !           166: ^rusage[]
        !           167: # а это мы можем вывести список макросов, которые outdated, но которые вызывались...
        !           168: # ^printOutdatedMacro[]
        !           169: #end @postprocess[body]
        !           170: 
        !           171: 
        !           172: 
        !           173: #################################################################################################
        !           174: @rusage[msg][rusage]
        !           175: #^if(!in "/admin/"){
        !           176: $rusage[$status:rusage]
        !           177: $now[^date::now[]]
        !           178: $s[[^now.sql-string[]] $rusage.utime   $rusage.stime   $rusage.maxrss  $rusage.ixrss   $rusage.idrss   $rusage.isrss   $request:uri    $env:REMOTE_ADDR        [$status:memory.used/$status:memory.free/$status:memory.since_compact/$status:memory.process] $msg^#0A]
        !           179: ^s.save[append;/../data/rusage.log]
        !           180: #}
        !           181: #end @rusage[]
        !           182: 
        !           183: 
        !           184: 
        !           185: #################################################################################################
        !           186: # этот метод выведет статистику, собранную экземпляром класса $MAIN:pSQL
        !           187: @getStat[]
        !           188: ^if(def $MAIN:pSQL && $MAIN:pSQL.debug){
        !           189:        $result[^MAIN:pSQL.getStatistics[/../data/sql.txt]]
        !           190: }{
        !           191:        $result[]
        !           192: }
        !           193: #end @stat[]
        !           194: 
        !           195: 
        !           196: 
        !           197: #################################################################################################
        !           198: # метод достает названия методов с комментариями у указаного файла и показывает их
        !           199: @getComments[f][file;fd;t;comments]
        !           200: $file[^if(def $f){$f}{/../data/classes/engine.p}]
        !           201: ^if(-f $file){
        !           202:        $fd[^file::load[text;$file]]
        !           203:        
        !           204:        $t[$fd.text]
        !           205:        $t[^t.match[^^##[^^#]*^$][mg]{}]
        !           206:        $t[^t.match[(\n){3,}][g]{${match.1}$match.1}]
        !           207:        $comments[^t.match[(#{5,}\n#\s.*?\n@.+?\^])][g]]
        !           208:        
        !           209:        $result[^taint[as-is][^comments.menu{$comments.1^#0A^#0A^#0A}]]
        !           210: }
        !           211: #end @getComments[]

E-mail: