<commit_before><?php
namespace ToolkitApi;

/**
 * httpsupp is an experimental class (not supported by Zend at this time) that 
 * provides an 'http' driverless transport.
 * 
 * To set up your server for HTTP/CGI look here:
 * http://192.168.127.12/wiki/index.php/XMLService/XMLService
 * and read: "Optional XMLSERVICE REST interface via RPG CGI (xmlcgi.pgm)" 
 *
 * transport: REST POST
 * HTTP based transport to XMLSERVICE:
 * script.php(http://ibmi/cgi-bin/xmlcgi.pgm)--->XMLCGI.PGM--->XMLSERVICE
 * Apache conf (httpd.conf):
 * ScriptAlias /cgi-bin/ /QSYS.LIB/XMLSERVICE.LIB/
 * 
 * <Directory /QSYS.LIB/XMLSERVICE.LIB/>
 *      AllowOverride None
 *      order allow,deny
 *      allow from all
 *      SetHandler cgi-script
 *      Options +ExecCGI
 * </Directory>
 * 
 * @todo define common transport class/interface extended/implemented by all transports. They have much in common.
 * 
 * @package ToolkitApi
 */
class httpsupp
{
    protected $last_errorcode;
    protected $last_errormsg;
    protected $_ipc;
    protected $_ctl;
    protected $_url;
    protected $_db;
    protected $_user;
    protected $_pw;
    protected $_debug;
    
    // parms [$ipc, $ctl, $i5rest, $debug]:
    //   $ipc - route to XMLSERVICE job (/tmp/xmlibmdb2)
    //   $ctl - XMLSERVICE control (*sbmjob)
    //   $i5rest - URL to xmlcgi.pgm
    //      (example: http://ibmi/cgi-bin/xmlcgi.pgm )
    //   $debug=*in|*out|*all
    //     *in - dump XML input (call)
    //     *out - dump XML output (return)
    //     *all - dump XML input/output
    public function __construct($ipc='/tmp/xmldb2', $ctl='*sbmjob', $url='http://example.com/cgi-bin/xmlcgi.pgm', $debug='*none')
    {
        $this->setIpc($ipc);
        $this->setCtl($ctl);
        $this->setUrl($url);
        $this->_debug = $debug;
    }

    /**
     * @param $xmlIn<commit_msg>Cleaned docblock of constructor<commit_after><?php
namespace ToolkitApi;

/**
 * httpsupp is an experimental class (not supported by Zend at this time) that 
 * provides an 'http' driverless transport.
 * 
 * To set up your server for HTTP/CGI look here:
 * http://192.168.127.12/wiki/index.php/XMLService/XMLService
 * and read: "Optional XMLSERVICE REST interface via RPG CGI (xmlcgi.pgm)" 
 *
 * transport: REST POST
 * HTTP based transport to XMLSERVICE:
 * script.php(http://ibmi/cgi-bin/xmlcgi.pgm)--->XMLCGI.PGM--->XMLSERVICE
 * Apache conf (httpd.conf):
 * ScriptAlias /cgi-bin/ /QSYS.LIB/XMLSERVICE.LIB/
 * 
 * <Directory /QSYS.LIB/XMLSERVICE.LIB/>
 *      AllowOverride None
 *      order allow,deny
 *      allow from all
 *      SetHandler cgi-script
 *      Options +ExecCGI
 * </Directory>
 * 
 * @todo define common transport class/interface extended/implemented by all transports. They have much in common.
 * 
 * @package ToolkitApi
 */
class httpsupp
{
    protected $last_errorcode;
    protected $last_errormsg;
    protected $_ipc;
    protected $_ctl;
    protected $_url;
    protected $_db;
    protected $_user;
    protected $_pw;
    protected $_debug;
    
    /**
     * @param string $ipc route to XMLSERVICE job (/tmp/xmlibmdb2)
     * @param string $ctl XMLSERVICE control (*sbmjob)
     * @param string $url URL to xmlcgi.pgm (example: http://ibmi/cgi-bin/xmlcgi.pgm )
     * @param string $debug *in|*out|*all (*in - dump XML input (call)) (*out - dump XML output (return)) (*all - dump XML input/output)
     */
    public function __construct($ipc='/tmp/xmldb2', $ctl='*sbmjob', $url='http://example.com/cgi-bin/xmlcgi.pgm', $debug='*none')
    {
        $this->setIpc($ipc);
        $this->setCtl($ctl);
        $this->setUrl($url);
        $this->_debug = $debug;
    }

    /**
     * @param $xmlIn
{'fraction_non_alphanumeric': 0.14196525515743758, 'fraction_numerical': 0.00760043431053203, 'mean_word_length': 2.7794871794871794, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1168434', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1226, 'n_words': 316}