You are here

function _porterstemmer_pecl_loaded in Porter-Stemmer 8

Same name and namespace in other branches
  1. 6.2 porterstemmer.module \_porterstemmer_pecl_loaded()
  2. 7 porterstemmer.module \_porterstemmer_pecl_loaded()

Checks to see if the PECL stem extension has been loaded.

Return value

bool TRUE if the stem_english() function from the PECL stem library can be used, FALSE if not.

1 call to _porterstemmer_pecl_loaded()
porterstemmer_search_preprocess in ./porterstemmer.module
Implements hook_search_preprocess().

File

./porterstemmer.module, line 87
Contains porterstemmer.module.

Code

function _porterstemmer_pecl_loaded() {
  static $has_pecl_stem = FALSE;
  static $already_checked = FALSE;
  if ($already_checked) {
    return $has_pecl_stem;
  }
  $has_pecl_stem = extension_loaded('stem') && function_exists('stem_english');
  $already_checked = TRUE;
  return $has_pecl_stem;
}