Beispiel #1
0
 /**
  * @return IfwPsn_Wp_Http_Request
  */
 protected function _getRequest()
 {
     if ($this->_request === null) {
         $this->_request = new IfwPsn_Wp_Http_Request();
         $this->_request->setUrl($this->_pm->getConfig()->plugin->updateServer);
         $this->_request->addData('api-key', md5(IfwPsn_Wp_Proxy_Blog::getUrl()));
         $this->_request->addData('referrer', IfwPsn_Wp_Proxy_Blog::getUrl());
         if (isset($_SERVER['HTTP_USER_AGENT'])) {
             $this->_request->addData('browser_user_agent', $_SERVER['HTTP_USER_AGENT']);
         }
     }
     return $this->_request;
 }
Beispiel #2
0
 /**
  * @return IfwPsn_Wp_Http_Request
  */
 protected function _getRequest($endpoint = 'am-software-api')
 {
     $result = null;
     if ($this->_isAllowedEndpoint($endpoint)) {
         $url = $this->_pm->getConfig()->plugin->updateServer;
         $url = add_query_arg('wc-api', $endpoint, $url);
         $url = esc_url_raw($url);
         $request = new IfwPsn_Wp_Http_Request();
         $request->setSendMethod('get');
         $request->setUrl($url);
         $request->addData('product_id', $this->_getProductId());
         $result = $request;
     }
     return $result;
 }
Beispiel #3
0
 /**
  *
  */
 protected function _init()
 {
     parent::_init();
     $this->setUrl($this->_pm->getConfig()->plugin->updateServer);
     $this->addData('api-key', md5(IfwPsn_Wp_Proxy_Blog::getUrl()));
 }