Just a simple proposal: Add a apachesolr_server_status() function that encapsulates the ping functionality used for apachesolr_requirements().
It would a) clean up the code a bit and b) allow developers of related modules (like me) to simply use that function, instead of manually copying the code. Nothing fancy or vital, but maybe helpful, at least to me.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | server_status-function.patch | 2.39 KB | drunken monkey |
| #2 | server_status-function--no-iff.patch | 2.41 KB | drunken monkey |
| server_status-function.patch | 2.4 KB | drunken monkey |
Comments
Comment #1
robertdouglass commented+ watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
you only want to use nl2br when doing drupal_set_message, not for watchdog.
There's a spelling error (iff -> if)
Comment #2
drunken monkeyThanks for the tip, corrected that.
Althoug it is worth mentioning that I only copied that from the apachesolr_requirements() function. The same code is also used at many other places in the module:
It's not an error, "iff" is a (as far as I know rather common) short form of "if, and only if". But if it isn't as well-known as I thought, we can of course leave it out. In that case, use the second patch.
Comment #3
robertdouglass commentedOh, I didn't know that! iff
Comment #4
robertdouglass commentedCommitted, thanks.