Commit 64c94018 authored by Bas de Nooijer's avatar Bas de Nooijer

Ping query now correctly detects 4xx/5xx errors and offers access to response data

parent 87f0fc89
......@@ -14,8 +14,10 @@ $ping = $client->createPing();
// execute the ping query
try{
$client->ping($ping);
$result = $client->ping($ping);
echo 'Ping query succesful';
echo '<br/><pre>';
var_dump($result->getData());
}catch(Solarium_Exception $e){
echo 'Ping query failed';
}
......
......@@ -55,7 +55,8 @@ class Solarium_Client_RequestBuilder_Ping extends Solarium_Client_RequestBuilder
{
$request = new Solarium_Client_Request;
$request->setHandler($query->getHandler());
$request->setMethod(Solarium_Client_Request::METHOD_HEAD);
$request->setMethod(Solarium_Client_Request::METHOD_GET);
$request->addParam('wt', 'json');
return $request;
}
......
......@@ -45,7 +45,7 @@
* @package Solarium
* @subpackage Result
*/
class Solarium_Result_Ping
class Solarium_Result_Ping extends Solarium_Result
{
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment