home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (mimemail_compress.install)

This example Drupal source code file (mimemail_compress.install) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, dom, enabled, extension, function, get_t, if, phase, php, requirement_error, requirements, runtime, title, translate

The mimemail_compress.install Drupal example source code

<?php

// $Id: mimemail_compress.install,v 1.1.2.2 2010/10/30 18:00:24 sgabe Exp $

/**
 * Implementation of hook_requirements().
 */
function mimemail_compress_requirements($phase) {
  $requirements = array();
  // Ensure translations don't break at install time.
  $t = get_t();

  // Test PHP DOM Extension.
  $requirements['dom'] = array(
    'title' => $t('PHP DOM Extension')
  );

  if (!extension_loaded('dom')) {
    $requirements['dom']['description'] = $t('Mime Mail Compress requires the PHP DOM extension to be enabled.');
    $requirements['dom']['severity'] = REQUIREMENT_ERROR;
    if ($phase == 'runtime') {
      $requirements['dom']['value'] = $t('Disabled');
    }
  }
  elseif ($phase == 'runtime') {
    $requirements['dom']['value'] = $t('Enabled');
  }

  return $requirements;
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal mimemail_compress.install source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.