public function getTableDefinition(Trace $trace, DOMDocument $dom) { $trace->tlog("finding table definition element"); $trace->tlogVariable("", $dom->saveXML()); $element = $dom->getElementById('dataTabColGroup'); if ($element == null) { throw new Exception("Can't find table headers"); } $list = $element->getElementsByTagName('col'); $columns = array(); foreach ($list as $node) { assert($node->hasAttribute('shortname')); $columns[] = $node->getAttribute('shortname'); } $trace->tlogVariable("Parsed columns:", $columns); return $columns; }
public function post(Trace $trace, $url, $data) { $trace->tlog("Http POST"); $trace->tlogVariable("URL", $url); $child = $trace->addChild("POST data"); $child->tlogVariable("post_data", $data); curl_setopt($this->curl, CURLOPT_URL, $url); curl_setopt($this->curl, CURLOPT_POST, true); $newPost = ''; foreach ($data as $key => $value) { $newPost .= urlencode($key) . '=' . urlencode($value) . '&'; } $post = substr($newPost, 0, -1); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $post); return $this->exec($trace); }