You are here

function _porterstemmer_pecl_loaded in Porter-Stemmer 7

Same name and namespace in other branches
  1. 8 porterstemmer.module \_porterstemmer_pecl_loaded()
  2. 6.2 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.

2 calls to _porterstemmer_pecl_loaded()
PorterStemmerOutput1UnitTest::setUp in ./porterstemmer.test
Sets up a Drupal site for running functional and integration tests.
porterstemmer_search_preprocess in ./porterstemmer.module
Implements hook_search_preprocess().

File

./porterstemmer.module, line 139
Porter 2 Stemming for Drupal.

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;
}