? status_report.patch
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.10
diff -u -F^f -r1.1.2.10 apachesolr.module
--- apachesolr.module	20 Apr 2008 13:13:35 -0000	1.1.2.10
+++ apachesolr.module	20 Apr 2008 13:44:15 -0000
@@ -45,6 +45,40 @@ function apachesolr_settings() {
   return system_settings_form($form);
 }
 
+function apachesolr_requirements($phase) {
+  // Ensure translations don't break at install time
+  $t = get_t();
+  if ($phase == 'runtime') {
+    $host = variable_get('apachesolr_host', 'localhost');
+    $port = variable_get('apachesolr_port', 8983);
+    $path = variable_get('apachesolr_path', '/solr');
+    $ping = FALSE;
+    try {
+      $solr =& apachesolr_get_solr($host, $port, $path);
+      $ping = $solr->ping();
+      // If there is no $solr object, there is no server available, so don't continue.
+      if (!$ping) {
+        throw new Exception(t('No Solr instance available during indexing'));
+      }
+    }
+    catch (Exception $e) {
+      watchdog('Apache Solr', $e->getMessage(), WATCHDOG_ERROR);
+    }
+    $value =  $ping ? $t('Solr can be pinged.'): $t('No Solr instance is available.');
+    $severity = $ping ? REQUIREMENT_OK: REQUIREMENT_ERROR;
+    $description = theme('item_list', array($t('Host: %host', array('%host' => $host)),
+                        $t('Port: %port', array('%port' => $port)),
+                        $t('Path: %path', array('%path' => $path))));
+    $requirements['apachesolr'] = array(
+      'title' => $t('ApacheSolr'),
+      'value' => $value,
+      'description' => $description,
+      'severity' => $severity,
+    );
+    return $requirements;
+  }
+}
+
 function apachesolr_index_page() {
   //TODO: Should we be generating the dynamic blocks based on what is indexed?
   // Or should we be using things like node_field.type to get this list?
Index: SolrPhpClient/Apache/Solr/Service.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/SolrPhpClient/Apache/Solr/Service.php,v
retrieving revision 1.1
diff -u -F^f -r1.1 Service.php
--- SolrPhpClient/Apache/Solr/Service.php	27 Dec 2007 20:33:50 -0000	1.1
+++ SolrPhpClient/Apache/Solr/Service.php	20 Apr 2008 13:44:15 -0000
@@ -414,8 +414,8 @@
     $start = microtime(true);
 
     //try to connect to the host with timeout
-    $fp = fsockopen($this->_host, $this->_port, $errno, $errstr, $timeout);
-
+    $fp = @fsockopen($this->_host, $this->_port, $errno, $errstr, $timeout);
+    
     if ($fp)
     {
       //If we have a timeout set, then determine the amount of time we have left
