Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
64c94018
Commit
64c94018
authored
Oct 14, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ping query now correctly detects 4xx/5xx errors and offers access to response data
parent
87f0fc89
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
examples/1.1-check-solarium-and-ping.php
examples/1.1-check-solarium-and-ping.php
+3
-1
library/Solarium/Client/RequestBuilder/Ping.php
library/Solarium/Client/RequestBuilder/Ping.php
+2
-1
library/Solarium/Result/Ping.php
library/Solarium/Result/Ping.php
+1
-1
No files found.
examples/1.1-check-solarium-and-ping.php
View file @
64c94018
...
...
@@ -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'
;
}
...
...
library/Solarium/Client/RequestBuilder/Ping.php
View file @
64c94018
...
...
@@ -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
;
}
...
...
library/Solarium/Result/Ping.php
View file @
64c94018
...
...
@@ -45,7 +45,7 @@
* @package Solarium
* @subpackage Result
*/
class
Solarium_Result_Ping
class
Solarium_Result_Ping
extends
Solarium_Result
{
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment