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

version» Context lines:

Roxen.git/server/modules/scripting/perl.pike:6:      //<locate-token project="perl_module">LOCALE</locale-token>   // USE_DEFERRED_LOCALE;   #define LOCALE(X,Y) _DEF_LOCALE("perl_module",X,Y)      #include <module.h>   inherit "module";   inherit "roxenlib";      string cvs_version = -  "$Id: perl.pike,v 2.13 2001/01/12 17:06:00 leif Exp $"; +  "$Id: perl.pike,v 2.14 2001/01/13 18:18:17 nilsson Exp $";      constant module_type = MODULE_FILE_EXTENSION | MODULE_TAG;      constant module_name = "Perl support";   constant module_doc =    "This module provides a faster way of running Perl scripts with Roxen. "    "The module also optionally provides a &lt;perl&gt;..&lt;/perl&gt; "    "container to run Perl code from inside RXML pages.";      static string recent_error = 0;
Roxen.git/server/modules/scripting/perl.pike:116: Inside #if constant(getpwnam)
     #if constant(getpwnam)    if (handler_settings->set_uid)    s += sprintf("<b>Subprocess UID</b>: set uid=%O <br />\n",    handler_settings->set_uid);    else    s += "<b>Subprocess UID</b>: same as Roxen<br />\n";   #endif       s += "<b>Helper script</b>: "; -  if (Stdio.File(QUERY(helper), "r")) -  s += "found: " + QUERY(helper)+" <br />\n"; +  if (Stdio.File(query("helper"), "r")) +  s += "found: " + query("helper")+" <br />\n";    else    s += "not found.<br />\n";       if (recent_error)    s += "<b>Most recent error</b>: " + recent_error + " <br />\n";       return s;   }      static object gethandler() - { return ExtScript.getscripthandler(QUERY(helper), -  QUERY(parallel), handler_settings); + { return ExtScript.getscripthandler(query("helper"), +  query("parallel"), handler_settings);   }      static void fix_settings()   {    string u, g;    mapping s = ([ ]);      #if constant(getpwnam) -  if (sscanf(QUERY(identity), "%s:%s", u, g) == 2) +  if (sscanf(query("identity"), "%s:%s", u, g) == 2)    {    array ua = getpwnam(u), ga = getgrnam(g);       if (!ua) ua = getpwuid((int) u);    if (!ga) ga = getgrgid((int) g);       if (ua) s->set_uid = ua[2];    if (ga) s->set_gid = ga[2];    }   #endif
Roxen.git/server/modules/scripting/perl.pike:163:   static void periodic()   {    fix_settings();    ExtScript.periodic_cleanup();    call_out(periodic, 900);   }      void start()   {    periodic(); -  script_output_mode = QUERY(scriptout); +  script_output_mode = query("scriptout");   }      static void add_headers(string headers, object id)   { string header, name, value;    if (headers)    foreach(headers / "\r\n", header)    { if (sscanf(header, "%[^:]:%s", name, value) == 2)    switch (name)    { case "Content-Type":    case "Content-Encoding":
Roxen.git/server/modules/scripting/perl.pike:223:    if (script_output_mode == "HTTP")    bt = catch (result = h->run(id->realfile, id, do_response_callback));    else    bt = catch (result = h->run(id->realfile, id));       ++script_calls;       if (bt)    { ++script_errors;    report_error("Perl script `" + id->realfile + "' failed.\n"); -  if (QUERY(showbacktrace)) +  if (query("showbacktrace"))    return Roxen.http_string_answer("<h1>Script Error!</h1>\n<pre>" +    describe_backtrace(bt) + "\n</pre>");    else    return Roxen.http_string_answer("<h1>Script Error!</h1>");    }    else if (arrayp(result))    { string r = sizeof(result) > 1 ? result[1] : "";   // werror("Result: " + sprintf("%O", r) + "\n");    if (r == "") r = " "; // Some browsers don't like null answers.    if (!stringp(r)) r = "(not a string)";
Roxen.git/server/modules/scripting/perl.pike:272:    }       return 0;   }      constant simpletag_perl_flags = 0;      mixed simpletag_perl(string tag, mapping attr, string contents, object id,    RXML.Frame frame)   { -  if (!QUERY(tagenable)) +  if (!query("tagenable"))    RXML.run_error("Perl tag not enabled in this server.");       object h = gethandler();       if (!h)    RXML.run_error("Perl tag support unavailable.");       NOCACHE();       array result;
Roxen.git/server/modules/scripting/perl.pike:294:    ++parsed_tags;       if (bt)    {    werror("Perl tag backtrace:\n" + describe_backtrace(bt) + "\n");    RXML.run_error("Perl tag");    }    else if (sizeof(result) > 1)    { if (result[0] < 0 || !stringp(result[1]))    return "SCRIPT ERROR: " + sprintf("%O", result[1]); -  else if (QUERY(rxmltag)) +  else if (query("rxmltag"))    {    frame->result_type = frame->result_type(RXML.PXml);    return Roxen.parse_rxml(result[1], id);    }    else    return result[1];    }    else    return sprintf("SCRIPT ERROR: bad result: %O", result);   
Roxen.git/server/modules/scripting/perl.pike:316:   }      mixed simple_pi_tag_perl(string tag, mapping attr, string contents, object id,    RXML.Frame frame)   {    return simpletag_perl(tag, attr, contents, id, frame);   }      array(string) query_file_extensions()   { -  return (QUERY(extensions) - " ") / ","; +  return (query("extensions") - " ") / ",";   }      TAGDOCUMENTATION;   #ifdef manual   constant tagdoc=([   "<?perl":#"<desc pi><short hide>    Perl processing instruction tag.</short>This processing intruction    tag allows for evaluating Perl code directly in the document.</p>       <p>Note: Read the installation and configuration documentation in the