/[drupal]/contributions/modules/apachesolr/apachesolr.module
ViewVC logotype

Diff of /contributions/modules/apachesolr/apachesolr.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.12.2.171 by robertDouglass, Mon Oct 26 19:17:34 2009 UTC revision 1.1.2.12.2.172 by pwolanin, Sun Nov 15 14:52:28 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: apachesolr.module,v 1.1.2.12.2.170 2009/10/26 02:04:12 pwolanin Exp $  // $Id: apachesolr.module,v 1.1.2.12.2.171 2009/10/26 19:17:34 robertDouglass Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 115  function apachesolr_failure($search_name Line 115  function apachesolr_failure($search_name
115  }  }
116    
117  /**  /**
  * Implementation of hook_requirements().  
  */  
 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();  
       $ping = @$solr->ping(variable_get('apachesolr_ping_timeout', 4));  
       // 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 when checking requirements.'));  
       }  
     }  
     catch (Exception $e) {  
       watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);  
     }  
     $value =  $ping ? $t('Your site has contacted the Apache Solr server.') : $t('Your site was unable to contact the Apache Solr server.');  
     $severity = $ping ? 0: 2;  
     $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('Apache Solr'),  
       'value' => $value,  
       'description' => $description,  
       'severity' => $severity,  
     );  
     return $requirements;  
   }  
 }  
   
 /**  
118   * Like $site_key in _update_refresh() - returns a site-specific hash.   * Like $site_key in _update_refresh() - returns a site-specific hash.
119   */   */
120  function apachesolr_site_hash() {  function apachesolr_site_hash() {

Legend:
Removed from v.1.1.2.12.2.171  
changed lines
  Added in v.1.1.2.12.2.172

  ViewVC Help
Powered by ViewVC 1.1.3