You are here

function apachesolr_stats_get_search_page_by_path in Apache Solr Statistics 6.3

Same name and namespace in other branches
  1. 7 apachesolr_stats.module \apachesolr_stats_get_search_page_by_path()

Return a search page by the base path, e.g. 'search/site'

Parameters

string $path:

Return value

bool|array Returns FALSE if no page found, or the search page as returned by apachesolr_search_page_load($page_id);

1 call to apachesolr_stats_get_search_page_by_path()
apachesolr_stats_exit in ./apachesolr_stats.module
Implementation of hook_exit().

File

./apachesolr_stats.module, line 225
Keeps and reports statistics about Apache Solr usage and performance.

Code

function apachesolr_stats_get_search_page_by_path($path) {
  $search_pages = apachesolr_search_load_all_search_pages();
  foreach ($search_pages as $search_page) {
    if (strpos($path, $search_page['search_path']) === 0) {
      return $search_page;
    }
  }
  return FALSE;
}