You are here

potx.install in Translation template extractor 7

Install requirements checking for the module.

File

potx.install
View source
<?php

/**
 * @file
 *   Install requirements checking for the module.
 */

/**
 * Implementation of hook_requirements().
 *
 * The translation template extractor requires the PHP token extension to
 * be enabled. We should not let Drupal to install the module if this is
 * not available. Also, if it was available, but the site was moved or
 * PHP was changed, we should nag again: so we run in install and runtime
 * as well.
 */
function potx_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if (!function_exists('token_get_all')) {
    $requirements['potx_tokenizer'] = array(
      'title' => $t('PHP tokenizer for Translation template extractor'),
      'value' => $t('Not available'),
      'description' => $t('The <a href="@tokenizer">PHP tokenizer functions</a> are required.', array(
        '@tokenizer' => 'http://php.net/tokenizer',
      )),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}

Functions

Namesort descending Description
potx_requirements Implementation of hook_requirements().