You are here

function panopoly_search_modules_enabled in Panopoly Search 7

Implementation of hook_modules_enabled()

File

./panopoly_search.module, line 106

Code

function panopoly_search_modules_enabled($modules) {

  // If we are running on Pantheon enable Solr support
  if (in_array('panopoly_search', $modules) && variable_get('pantheon_tier', FALSE) && variable_get('panopoly_search_enable_pantheon_apachesolr', TRUE) && module_enable(array(
    'pantheon_apachesolr',
  ))) {

    // Supress the message from enabling Panopoly Apachesolr since we are configuring it automatically
    drupal_get_messages('status');

    // Push Pantheon's Solr schema for use with search_api.
    $schema_uri = drupal_get_path('module', 'search_api_solr') . '/solr-conf/3.x/schema.xml';
    $response = pantheon_apachesolr_post_schema_exec($schema_uri);

    // If successful, then enable Panopoly's Solr server and index.
    if ($response != NULL) {
      panopoly_search_enable_solr();
    }
  }
}