From 905fb31330e8ecfca311780b91f8cd9eb7e37d78 Mon Sep 17 00:00:00 2001
From: Bob Vincent <bobvin@pillars.net>
Date: Mon, 2 May 2011 08:55:26 -0400
Subject: [PATCH] Issue #914742 by kratkar, David_Rothstein, jczuo, Damien Tournoud, carlos8f: Add hook_requirements() for buggy versions of eAccelerator.

---
 modules/system/system.install |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules/system/system.install b/modules/system/system.install
index 6d2fc80975af0363ae3ffde7164262ab378d2211..9c77267f39de93e5f623483bd2930f50539bc960 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -86,6 +86,20 @@ function system_requirements($phase) {
     return $requirements;
   }
 
+  // Test for eAccelerator.
+  if (function_exists('eaccelerator_info')) {
+    $info = eaccelerator_info();
+    $eaccelerator_minimum_version = '0.9.5.3';
+    if (version_compare($info['version'], $eaccelerator_minimum_version, '<')) {
+      $requirements['php_eaccelerator'] = array(
+        'title' => $t('eAccelerator'),
+        'value' => $info['version'],
+        'description' => $t('Your eAccelerator installation is too old. Drupal is only compatible with version %version or later.', array('%version' => $eaccelerator_minimum_version)),
+        'severity' => REQUIREMENT_ERROR,
+      );
+    }
+  }
+
   // Test PHP register_globals setting.
   $requirements['php_register_globals'] = array(
     'title' => $t('PHP register globals'),
-- 
1.7.4.1

