Explorar o código

Protects the setup in case of missing PHP-JSON module

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3022 a333f486-631f-4898-b8df-5754b55c2be0
dflaven %!s(int64=11) %!d(string=hai) anos
pai
achega
97359ea05f
Modificáronse 1 ficheiros con 19 adicións e 0 borrados
  1. 19 0
      setup/index.php

+ 19 - 0
setup/index.php

@@ -37,5 +37,24 @@ ini_set('max_execution_time', max(240, ini_get('max_execution_time')));
 ini_set('display_errors', true);
 ini_set('display_errors', true);
 ini_set('display_startup_errors', true);
 ini_set('display_startup_errors', true);
 
 
+/////////////////////////////////////////////////////////////////////
+// Fake functions to protect the first run of the installer
+// in case the PHP JSON module is not installed...
+if (!function_exists('json_encode'))
+{
+	function json_encode($value, $options = null)
+	{
+		return '[]';
+	}
+}
+if (!function_exists('json_decode'))
+{
+	function json_decode($json, $assoc=null)
+	{
+		return array();
+	}
+}
+/////////////////////////////////////////////////////////////////////
+
 $oWizard = new WizardController('WizStepWelcome');
 $oWizard = new WizardController('WizStepWelcome');
 $oWizard->Run();
 $oWizard->Run();