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

Drupal example source code file (imageapi.install)

This example Drupal source code file (imageapi.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, count, function, if, imageapi, imageapi_uninstall, imagemagick, modules, phase, php, requirement_error, requirements, toolkit, value

The imageapi.install Drupal example source code

// $Id: imageapi.install,v 1.7 2008/12/21 23:08:39 drewish Exp $

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

  // Check this at runtime rather than install time because the order of
  // installation doesn't take dependencies into account. ImageAPI may have
  // been installed by not loaded and if we report a requirement error
  // because we can't find its function or no toolkit is enabled modules that
  // depend on us will still be enabled but will have a missing dependency.
  // Seems like a better idea to let everything get enabled and then inform
  // them of the problem.
  if ($phase == 'runtime') {
    if (count(imageapi_get_available_toolkits()) == 0) {
      $requirements['imageapi_toolkits'] = array(
        'title' => $t('ImageAPI Toolkit'),
        'value' => $t('No ImageAPI toolkits available'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('ImageAPI requires a Toolkit such as ImageAPI GD or ImageAPI ImageMagick to function. Go to !modules and enable one of them.', array('!modules' => l('admin/build/modules', 'admin/build/modules'))),

  return $requirements;
function imageapi_install() {

 * Implementation of hook_uninstall().
function imageapi_uninstall() {

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal imageapi.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.