Exemplo n.º 1
0
            die(sprintf("Config XML error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser)));
            //This is before we have the log location
        }
        xml_parser_free($this->parser);
        return $this->results;
    }
    function tagStart($parser, $name, $attrs)
    {
        $attrs = array_change_key_case($attrs, CASE_LOWER);
        $tag = array(strtolower($name) => $attrs);
        array_push($this->results, $tag);
    }
    function tagEnd($parser, $name)
    {
        //http://www.php.net/manual/en/function.xml-parse.php
        $this->results[count($this->results) - 2]['childrens'][] = $this->results[count($this->results) - 1];
        if (count($this->results[count($this->results) - 2]['childrens']) == 1) {
            $this->results[count($this->results) - 2]['firstchild'] =& $this->results[count($this->results) - 2]['childrens'][0];
        }
        array_pop($this->results);
    }
    function __destruct()
    {
    }
}
$proxyConfig = new ProxyConfig();
$proxyConfig->useXML();
//$proxyConfig->useJSON();
$proxyLog = new ProxyLog($proxyConfig);
$proxyObject = new Proxy($proxyConfig, $proxyLog);
$proxyObject->getResponse();