Selaa lähdekoodia

[svn r21548] FS#306 - Adding preliminary checks whether the PHP extension "mbstring" has been installed. See http://www.dokeos.com/forum/viewtopic.php?t=29548

Ivan Tcholakov 15 vuotta sitten
vanhempi
commit
58a144ad69
2 muutettua tiedostoa jossa 77 lisäystä ja 1 poistoa
  1. 38 0
      main/inc/global.inc.php
  2. 39 1
      main/install/index.php

+ 38 - 0
main/inc/global.inc.php

@@ -60,6 +60,44 @@ EOM;
 	die($error_message_php_version);
 }
 
+if (!function_exists('mb_strlen'))
+{
+	$error_message_mbstring = <<<EOM
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+		<head>
+			<title>PHP extension "mbstring" has not been installed!</title>
+			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+			<style type="text/css" media="screen, projection">
+				/*<![CDATA[*/
+				@import "main/css/public_admin/default.css";
+				/*]]>*/
+			</style>
+		</head>
+		<body>
+			<div id="header">
+				<div id="header1"><a href="http://www.dokeos.com" target="_blank">Dokeos Homepage</a></div>
+				<div class="clear"></div>
+				<div id="header2">&nbsp;</div>
+				<div id="header3">&nbsp;</div>
+			</div>
+
+			<div style="text-align: center;"><br /><br />
+					The Dokeos system needs PHP extension <strong>mbstring</strong> to be installed.<br />
+					See <a href="http://php.net/manual/en/mbstring.installation.php" target="_blank">http://php.net/manual/en/book.mbstring.php</a> for more information<br /><br />
+			</div>
+
+			<div id="footer">
+				<div class="copyright">Platform <a href="http://www.dokeos.com" target="_blank"> Dokeos </a> &copy; 2009 </div>
+				&nbsp;
+			</div>
+		</body>
+</html>
+EOM;
+	header('Content-Type: text/html; charset=UTF-8');
+	die($error_message_mbstring);
+}
+
 // Determine the directory path where this current file lies
 // This path will be useful to include the other intialisation files
 

+ 39 - 1
main/install/index.php

@@ -40,7 +40,7 @@
 
 /*
 ==============================================================================
-		PHP VERSION CHECK
+		PHP VERSION CHECK & MBSTRING EXTENSION CHECK
 ==============================================================================
 */
 
@@ -82,6 +82,44 @@ EOM;
 	die($error_message_php_version);
 }
 
+if (!function_exists('mb_strlen'))
+{
+	$error_message_mbstring = <<<EOM
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+		<head>
+			<title>PHP extension "mbstring" has not been installed!</title>
+			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+			<style type="text/css" media="screen, projection">
+				/*<![CDATA[*/
+				@import "../css/public_admin/default.css";
+				/*]]>*/
+			</style>
+		</head>
+		<body>
+			<div id="header">
+				<div id="header1"><a href="http://www.dokeos.com" target="_blank">Dokeos Homepage</a></div>
+				<div class="clear"></div>
+				<div id="header2">&nbsp;</div>
+				<div id="header3">&nbsp;</div>
+			</div>
+
+			<div style="text-align: center;"><br /><br />
+					The Dokeos system needs PHP extension <strong>mbstring</strong> to be installed.<br />
+					See <a href="http://php.net/manual/en/mbstring.installation.php" target="_blank">http://php.net/manual/en/book.mbstring.php</a> for more information<br /><br />
+			</div>
+
+			<div id="footer">
+				<div class="copyright">Platform <a href="http://www.dokeos.com" target="_blank"> Dokeos </a> &copy; 2009 </div>
+				&nbsp;
+			</div>
+		</body>
+</html>
+EOM;
+	header('Content-Type: text/html; charset=UTF-8');
+	die($error_message_mbstring);
+}
+
 /*
 ==============================================================================
 		INIT SECTION