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
3c4ab020
Commit
3c4ab020
authored
May 30, 2011
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- small fixes
parent
2e589683
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
8 deletions
+66
-8
library/Solarium/Client/Adapter/Http.php
library/Solarium/Client/Adapter/Http.php
+2
-2
library/Solarium/Client/Adapter/ZendHttp.php
library/Solarium/Client/Adapter/ZendHttp.php
+1
-1
library/Solarium/Client/Request.php
library/Solarium/Client/Request.php
+3
-3
library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php
...m/Client/RequestBuilder/Select/Component/Highlighting.php
+1
-1
library/Solarium/Result/Ping.php
library/Solarium/Result/Ping.php
+15
-1
tests/Solarium/Result/PingTest.php
tests/Solarium/Result/PingTest.php
+44
-0
No files found.
library/Solarium/Client/Adapter/Http.php
View file @
3c4ab020
...
...
@@ -133,17 +133,17 @@ class Solarium_Client_Adapter_Http extends Solarium_Client_Adapter
*/
protected
function
_getData
(
$uri
,
$context
)
{
// @codeCoverageIgnoreStart
$data
=
@
file_get_contents
(
$uri
,
false
,
$context
);
// @codeCoverageIgnoreStart
if
(
isset
(
$http_response_header
))
{
$headers
=
$http_response_header
;
}
else
{
$headers
=
array
();
}
// @codeCoverageIgnoreEnd
return
array
(
$data
,
$headers
);
// @codeCoverageIgnoreEnd
}
}
\ No newline at end of file
library/Solarium/Client/Adapter/ZendHttp.php
View file @
3c4ab020
...
...
@@ -173,7 +173,7 @@ class Solarium_Client_Adapter_ZendHttp extends Solarium_Client_Adapter
}
// this is used because getHeaders doesn't return the HTTP header...
$headers
=
explode
(
"
\n
"
,
$response
->
getHeadersAsString
());
$headers
=
explode
(
"
\n
"
,
$response
->
getHeadersAsString
());
return
new
Solarium_Client_Response
(
$data
,
$headers
);
}
...
...
library/Solarium/Client/Request.php
View file @
3c4ab020
...
...
@@ -295,7 +295,7 @@ class Solarium_Client_Request extends Solarium_Configurable
/**
* Set request headers
*
* @
header
array $headers
* @
param
array $headers
* @return Solarium_Client_Request
*/
public
function
setHeaders
(
$headers
)
...
...
@@ -308,7 +308,7 @@ class Solarium_Client_Request extends Solarium_Configurable
/**
* Add a request header
*
* @
header
string|array $value
* @
param
string|array $value
* @return Solarium_Client_Request
*/
public
function
addHeader
(
$value
)
...
...
@@ -321,7 +321,7 @@ class Solarium_Client_Request extends Solarium_Configurable
/**
* Add multiple headers to the request
*
* @
header
array $headers
* @
param
array $headers
* @return Solarium_Client_Request
*/
public
function
addHeaders
(
$headers
)
...
...
library/Solarium/Client/RequestBuilder/Select/Component/Highlighting.php
View file @
3c4ab020
...
...
@@ -55,7 +55,7 @@ class Solarium_Client_RequestBuilder_Select_Component_Highlighting
public
function
build
(
$component
,
$request
)
{
// enable highlighting
$request
->
addParam
(
'hl'
,
'true'
);
$request
->
addParam
(
'hl'
,
'true'
);
$request
->
addParam
(
'hl.fl'
,
$component
->
getFields
());
$request
->
addParam
(
'hl.snippets'
,
$component
->
getSnippets
());
...
...
library/Solarium/Result/Ping.php
View file @
3c4ab020
...
...
@@ -39,7 +39,8 @@
/**
* Ping query result
*
* A ping query has no useful result (other than being succesful) so this class has no api
* A ping query has no useful result so only a dummy status var is available.
* If you don't get an exception for a ping query it was succesful.
*
* @package Solarium
* @subpackage Result
...
...
@@ -47,4 +48,17 @@
class
Solarium_Result_Ping
{
/**
* Get Solr status code
*
* Since no status is returned for a ping, a default of 0 is used.
* If you don't get an exception for a ping query it was succesful.
*
* @return int
*/
public
function
getStatus
()
{
return
0
;
}
}
\ No newline at end of file
tests/Solarium/Result/PingTest.php
0 → 100644
View file @
3c4ab020
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this listof conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are
* those of the authors and should not be interpreted as representing official
* policies, either expressed or implied, of the copyright holder.
*/
class
Solarium_Result_PingTest
extends
PHPUnit_Framework_TestCase
{
public
function
testGetStatus
()
{
$ping
=
new
Solarium_Result_Ping
();
$this
->
assertEquals
(
0
,
$ping
->
getStatus
()
);
}
}
\ No newline at end of file
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