From 336ee698d72567ba8a06a1bbb768d8dc7401895d Mon Sep 17 00:00:00 2001 From: Peter Murray Date: Wed, 27 Feb 2013 17:21:19 -0500 Subject: [PATCH] Add check for PHP XSLT Processor extension. When the PHP XSLT Processor extension is not loaded, Islandora will silently fail when attempting to add new objects. This changeset adds a check in the Islandora hook_requirements() hook for the XSLTProcessor class. If it isn't found, a message is thrown. Conflicts: islandora.install --- islandora.install | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/islandora.install b/islandora.install index 321f6f46..9a1825b5 100644 --- a/islandora.install +++ b/islandora.install @@ -5,6 +5,25 @@ * This file contains all install related hooks. */ +/** + * Implements hook_requirements(). + */ +function islandora_requirements($phase) { + $requirements = array(); + // Ensure translations don't break at install time + $t = get_t(); + + if (!class_exists('XSLTProcessor', FALSE)) { + $requirements['islandora_xsltprocessor']['title'] = $t('Islandora XSLTProcessor Prerequisite'); + $requirements['islandora_xsltprocessor']['value'] = $t('Not installed'); + $link = l($t('PHP XSL extension'), 'http://us2.php.net/manual/en/book.xsl.php', array('attributes' => array('target'=>'_blank'))); + $requirements['islandora_xsltprocessor']['description'] = $t('The !xsllink is required. Check your installed PHP extensions and php.ini file.', array('!xsllink' => $link)); + $requirements['islandora_xsltprocessor']['severity'] = REQUIREMENT_ERROR; + } + + return $requirements; +} + /** * Implements hook_install(). *