commit
56bc788d16
@ -221,7 +221,9 @@ class PrestaShopWebservice
|
|||||||
* Load XML from string. Can throw exception
|
* Load XML from string. Can throw exception
|
||||||
*
|
*
|
||||||
* @param string $response String from a CURL response
|
* @param string $response String from a CURL response
|
||||||
* @return SimpleXMLElement status_code, response
|
* @return SimpleXMLElement|boolean status_code, response
|
||||||
|
*
|
||||||
|
* @throw PrestaShopWebserviceException
|
||||||
*/
|
*/
|
||||||
protected function parseXML($response)
|
protected function parseXML($response)
|
||||||
{
|
{
|
||||||
@ -251,6 +253,8 @@ class PrestaShopWebservice
|
|||||||
*
|
*
|
||||||
* @param array $options Options
|
* @param array $options Options
|
||||||
* @return SimpleXMLElement status_code, response
|
* @return SimpleXMLElement status_code, response
|
||||||
|
*
|
||||||
|
* @throw PrestaShopWebserviceException
|
||||||
*/
|
*/
|
||||||
public function add($options)
|
public function add($options)
|
||||||
{
|
{
|
||||||
@ -268,10 +272,10 @@ class PrestaShopWebservice
|
|||||||
} else {
|
} else {
|
||||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||||
}
|
}
|
||||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml));
|
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml));
|
||||||
|
|
||||||
self::checkStatusCode($request['status_code']);
|
$this->checkStatusCode($request['status_code']);
|
||||||
return self::parseXML($request['response']);
|
return $this->parseXML($request['response']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -300,7 +304,9 @@ class PrestaShopWebservice
|
|||||||
* ?>
|
* ?>
|
||||||
* </code>
|
* </code>
|
||||||
* @param array $options Array representing resource to get.
|
* @param array $options Array representing resource to get.
|
||||||
* @return SimpleXMLElement status_code, response
|
* @return SimpleXMLElement|boolean status_code, response
|
||||||
|
*
|
||||||
|
* @throw PrestaShopWebserviceException
|
||||||
*/
|
*/
|
||||||
public function get($options)
|
public function get($options)
|
||||||
{
|
{
|
||||||
@ -326,9 +332,9 @@ class PrestaShopWebservice
|
|||||||
throw new PrestaShopWebserviceException('Bad parameters given ');
|
throw new PrestaShopWebserviceException('Bad parameters given ');
|
||||||
}
|
}
|
||||||
|
|
||||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
||||||
self::checkStatusCode($request['status_code']); // check the response validity
|
$this->checkStatusCode($request['status_code']); // check the response validity
|
||||||
return self::parseXML($request['response']);
|
return $this->parseXML($request['response']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -336,6 +342,8 @@ class PrestaShopWebservice
|
|||||||
*
|
*
|
||||||
* @param array $options Array representing resource for head request.
|
* @param array $options Array representing resource for head request.
|
||||||
* @return SimpleXMLElement status_code, response
|
* @return SimpleXMLElement status_code, response
|
||||||
|
*
|
||||||
|
* @throw PrestaShopWebserviceException
|
||||||
*/
|
*/
|
||||||
public function head($options)
|
public function head($options)
|
||||||
{
|
{
|
||||||
@ -358,8 +366,8 @@ class PrestaShopWebservice
|
|||||||
} else {
|
} else {
|
||||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||||
}
|
}
|
||||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true));
|
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true));
|
||||||
self::checkStatusCode($request['status_code']); // check the response validity
|
$this->checkStatusCode($request['status_code']); // check the response validity
|
||||||
return $request['header'];
|
return $request['header'];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -372,6 +380,8 @@ class PrestaShopWebservice
|
|||||||
*
|
*
|
||||||
* @param array $options Array representing resource to edit.
|
* @param array $options Array representing resource to edit.
|
||||||
* @return SimpleXMLElement status_code, response
|
* @return SimpleXMLElement status_code, response
|
||||||
|
*
|
||||||
|
* @throw PrestaShopWebserviceException
|
||||||
*/
|
*/
|
||||||
public function edit($options)
|
public function edit($options)
|
||||||
{
|
{
|
||||||
@ -390,9 +400,9 @@ class PrestaShopWebservice
|
|||||||
throw new PrestaShopWebserviceException('Bad parameters given');
|
throw new PrestaShopWebserviceException('Bad parameters given');
|
||||||
}
|
}
|
||||||
|
|
||||||
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml));
|
$request = $this->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml));
|
||||||
self::checkStatusCode($request['status_code']); // check the response validity
|
$this->checkStatusCode($request['status_code']); // check the response validity
|
||||||
return self::parseXML($request['response']);
|
return $this->parseXML($request['response']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
htdocs/admin/dolistore/class/index.html
Normal file
1
htdocs/admin/dolistore/class/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
1
htdocs/admin/dolistore/index.html
Normal file
1
htdocs/admin/dolistore/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user