Roxen.git / server / modules / scripting / piketag.pike

version» Context lines:

Roxen.git/server/modules/scripting/piketag.pike:1:   // This is a roxen module. Copyright © 1996 - 2000, Roxen IS.   //   // Adds support for inline pike in documents.   //   // Example:   // <pike>   // return "Hello world!\n";   // </pike>    - constant cvs_version = "$Id: piketag.pike,v 2.21 2000/09/10 16:47:49 nilsson Exp $"; + constant cvs_version = "$Id: piketag.pike,v 2.22 2000/09/15 11:19:41 jhs Exp $";   constant thread_safe=1;         #if constant(Parser.C)   #define PARSER_C Parser.C   #else   #define PARSER_C Roxen._Parser.C   #endif         inherit "module";   #include <module.h>      constant module_type = MODULE_TAG;   constant module_name = "Pike tag";   constant module_doc = #" - This module adds a processing instruction tag, <code>&lt;?pike ... - ?&gt;</code>, for evaluating Pike code directly in the document. + <p>This module adds a processing instruction tag, <code>&lt;?pike ... + ?&gt;</code>, for evaluating Pike code directly in the document.</p>      <p><img src=\"internal-roxen-err_2\" align=\"left\" alt=\"Warning\">   NOTE: Enabling this module is the same thing as letting your users - run programs with the same right as the server! + run programs with the same right as the server!</p>    - <p>Example: + <p>Example:</p>    - <p><pre>&lt;?pike write (\"Hello world!\\n\"); ?&gt;\n</pre> + <pre>&lt;?pike write (\"Hello world!\\n\"); ?&gt;\n</pre>    - <p>There are a few helper functions available: + <p>There are a few helper functions available:</p>      <dl>    <dt><code>write(string fmt, mixed ... args)</code></dt>    <dd>Formats a string in the same way as <code>printf</code> and    appends it to the output buffer. If given only one string    argument, it's written directly to the output buffer without being    interpreted as a format specifier.</dd>       <dt><code>flush()</code></dt>    <dd>Returns the contents of the output buffer and resets it.</dd>       <dt><code>rxml(string rxmlcode)</code></dt>    <dd>Parses the string with the RXML parser.</dd>   </dl>      <p>When the pike tag returns, the contents of the output buffer is - inserted into the page. It is not reparsed with the RXML parser. + inserted into the page. It is not reparsed with the RXML parser.</p>    - <p>These special constructs are also recognized: + <p>These special constructs are also recognized:</p>      <dl>    <dt><code>//O ... </code> or <code>/*O ... */</code></dt>    <dd>A Pike comment with an 'O' (the letter, not the number) as the    very first character treats the rest of the text in the comment as    output text that's written directly to the output buffer.</dd>       <dt><code>//X ... </code> or <code>/*X ... */</code></dt>    <dd>A Pike comment with an 'X' as the very first character treats    the rest of the text in the comment as RXML code that's executed
Roxen.git/server/modules/scripting/piketag.pike:72:    specified file.</dd>       <dt><code>#inherit \"...\"</code></dt>    <dd>An <code>#inherit</code> preprocessor directive puts a    corresponding inherit declaration in the class that's generated to    contain the Pike code in the tag.</dd>   </dl>      <p>When files are included or inherited, they will be read from the   virtual filesystem in Roxen, relative to the location during whose - parsing the pike tag was encountered. + parsing the pike tag was encountered. Entities and scopes are + available as variables named like the entity/scope itself. The + RequestID object is available as <code>id</code>.</p>      <p>Note that every RXML fragment is parsed by itself, so you can't - have unmatched RXML tags in them. E.g. the following does not work: + have unmatched RXML tags in them. E.g. the following does not work:</p>      <p><pre>&lt;?pike    //X &lt;gtext&gt;    write (\"Foo\");    //X &lt;/gtext&gt;   ?&gt;\n</pre>      <p>Adjacent 'X' comments are concatenated however, so the following - works: + works:</p>    - <p><pre>&lt;?pike + <pre>&lt;?pike    //X &lt;gtext&gt;    //X Foo    //X &lt;/gtext&gt;   ?&gt;\n</pre>      <p>For compatibility this module also adds the Pike container tag,   <code>&lt;pike&gt;...&lt;/pike&gt;</code>. It behaves exactly as it   did in Roxen 2.0 and earlier and the functionality mentioned above - does not apply to it. The use of the container tag is deprecated."; + does not apply to it. The use of the container tag is deprecated.</p>";      void create()   {    defvar("program_cache_limit", 256, "Program cache limit", TYPE_INT|VAR_MORE,    "Maximum size of the cache for compiled programs.");   }      // Helper functions, to be used in the pike script.   class Helpers   {
Roxen.git/server/modules/scripting/piketag.pike:502:       return res;   }      // --------------------- Documentation -----------------------      TAGDOCUMENTATION;   #ifdef manual   constant tagdoc=([   "<?pike":#"<desc pi><short hide> -  Pike processing instruction tag.</short>This processing intruction -  tag allows for evaluating Pike code directly in the document. +  <p>Pike processing instruction tag.</short>This processing intruction +  tag allows for evaluating Pike code directly in the document.</p>       <p>Note: With this tag, users are able to run programs with the same    right as the server. This is a serious security hasard.</p>       <p>When the pike tag returns, the contents of the output buffer is -  inserted into the page. It is not reparsed with the RXML parser. +  inserted into the page. It is not reparsed with the RXML parser.</p>   </desc>      <attr name='write' value='(string fmt, mixed ... args)'>    write() is a helper function. It formats a string in the same way as    printf and appends it to the output buffer. If given only one string    argument, it's written directly to the output buffer without being    interpreted as a format specifier.   </attr>      <attr name='flush' value='()'>    flush() is a helper function. It returns the contents of the output    buffer and resets it.   </attr>      <attr name='rxml' value='(string rxmlcode)'>    rxml() is a helper function. It parses the string with the RXML parser. - </attr> -  - ", + </attr>",    ]);   #endif