panjiwa10028 / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

Service#ping outputs Warning if the solr server is done. #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Stop the solr server
2. Call Apache_Solr_Service#ping for that server

What is the expected output? What do you see instead?
Expected: Just returns false without any output.
Actual: Outputs warning
<b>Warning</b>:  fsockopen() [<a
href='function.fsockopen'>function.fsockopen</a>]: unable to connect
 to localhost:8983 in Apache/Solr/Service.php on line
 <b>552</b>

What version of the product are you using? On what operating system?
2009-03-11

Please provide any additional information below.
To fix the problem, just add @ for fsockopen at line 552.
$fp = @fsockopen($this->_host, $this->_port, $errno, $errstr, $timeout);

Thanks for the library. It's wonderful.

Original issue reported on code.google.com by iwasaki....@gmail.com on 4 May 2009 at 3:04

GoogleCodeExporter commented 8 years ago
The featured downloads are a packaging of r5. r6 however has a change that 
accomplishes the same - the use 
of fsockopen was replaced with file_get_contents for consistency with the rest 
of code and as part of that 
refactor I added the suppression operator.

My fault for not creating a new package, I was originally holding off for 
testing to make sure I didn't break 
functionality.

In the meantime, if you're not comfortable doing a checkout then I think you 
can get the same effect by 
suppressing the actual ping call:

@$serviceInstance->ping();

Original comment by donovan....@gmail.com on 4 May 2009 at 4:00