v7‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT home/ajdemo/public_html/mempro/library/Am/HttpRequest.php000064400000006560152101617560017551 0ustar00setConfig('adapter', 'HTTP_Request2_Adapter_Curl'); $this->setConfig('proxy_host', Am_Di::getInstance()->config->get('http.proxy_host')); $this->setConfig('proxy_port', Am_Di::getInstance()->config->get('http.proxy_port')); $this->setConfig('proxy_user', Am_Di::getInstance()->config->get('http.proxy_user')); $this->setConfig('proxy_password', Am_Di::getInstance()->config->get('http.proxy_password')); $this->setConfig('ssl_verify_peer', Am_Di::getInstance()->config->get('http.verify_peer', false)); $this->setConfig('ssl_verify_host', Am_Di::getInstance()->config->get('http.verify_host', false)); $this->setConfig('ssl_cafile', Am_Di::getInstance()->config->get('http.ssl_cafile', null)); $this->setConfig('ssl_cafile', Am_Di::getInstance()->config->get('http.ssl_cafile', null)); parent::__construct($url, $method, $config); $this->setHeader('user-agent', 'aMember PRO/' . AM_VERSION . ' (http://www.amember.com)'); } function getPostParams() { return $this->postParams; } function toXml(XmlWriter $x, $writeEnvelope = true) { if ($writeEnvelope) $x->startElement('http-request'); $x->startElement('method'); $x->text($this->getMethod()); $x->endElement(); $x->startElement('url'); $x->text($this->getUrl()); $x->endElement(); $x->startElement('headers'); foreach ($this->getHeaders() as $k => $v) { $x->startElement('header'); $x->writeAttribute('name', $k); $x->text($v); $x->endElement(); } $x->endElement(); $x->startElement('params'); foreach ($this->getPostParams() as $k => $v) { $x->startElement('param'); $x->writeAttribute('name', $k); $x->text($v); $x->endElement(); } $x->endElement(); if (!$this->getPostParams() && $this->getBody()) // plain xml request? { $x->startElement('body'); $x->writeCdata($this->getBody()); $x->endElement(); } if ($writeEnvelope) $x->endElement(); } /** * For unit-testing only! * @access private * @return Am_HttpRequest_Adapter_Mock */ function _getAdapter() { return $this->adapter; } /** * Create an NVP request for PayPal/Payflow * @param type $flag */ function setNvpRequest($flag) { $this->nvpRequest = (bool)$flag; } public function getBody() { if ($this->nvpRequest) { $ret = ""; foreach ($this->postParams as $k => $v) { if ($ret) $ret .= '&'; $ret .= sprintf("%s[%d]=%s", $k, strlen($v), $v); } return $ret; } else { return parent::getBody(); } } }