Export to GitHub

solr-php-client - issue #7

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


Posted on May 4, 2009 by Quick Panda

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.

Comment #1

Posted on May 4, 2009 by Happy Bird

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();

Status: Invalid

Labels:
Type-Defect Priority-Medium