From c863d0a7ab9326f2c6ce3a49b55e00e2d672aabc Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 10 Feb 2010 10:38:53 +0000
Subject: [PATCH] - Patch #641408 by cha0s: test if json_encode() is available
 during installation.

---
 modules/system/system.install | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/system/system.install b/modules/system/system.install
index 162c6b90d7b5..bf0d6b2f5f50 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -108,6 +108,19 @@ function system_requirements($phase) {
     $requirements['pdo']['description'] = $t('Your server does not have the PHP PDO extension enabled. See the <a href="@system_requirements">system requirements page</a> for more information.', array('@system_requirements' => 'http://drupal.org/requirements'));
   }
 
+  // Test JSON library availability.
+  $requirements['json'] = array(
+    'title' => $t('JSON library'),
+  );
+  if (extension_loaded('json')) {
+    $requirements['json']['value'] = $t('Enabled');
+  }
+  else {
+    $requirements['json']['value'] = $t('Disabled');
+    $requirements['json']['severity'] = REQUIREMENT_ERROR;
+    $requirements['json']['description'] = $t('Your server does not have the PHP JSON extension enabled. See the <a href="@system_requirements">system requirements page</a> for more information.', array('@system_requirements' => 'http://drupal.org/requirements'));
+  }
+
   // Test PHP memory_limit
   $memory_limit = ini_get('memory_limit');
   $requirements['php_memory_limit'] = array(
-- 
GitLab