Rocco27 8 лет назад
Родитель
Сommit
5b70bed0ca
2 измененных файлов с 25 добавлено и 10 удалено
  1. 24 10
      install.php
  2. 1 0
      lang/English/install.php

+ 24 - 10
install.php

@@ -239,20 +239,22 @@ function install() {
             array( "name" => "PHP Curl module", "type" => "f", "value" => "curl_init" ),
             array( "name" => "PHP XML Reader", "type" => "c", "value" => "XMLReader" ),
 			array( "name" => "PHP JSON Extension", "type" => "f", "value" => "json_decode" ),
+			array( "name" => "PHP Zip Extension", "type" => "c", "value" => "ZipArchive" ),
 			array( "name" => "PHP mbstring Extension", "type" => "x", "value" => "mbstring" ));
+			
+		$optional_properties_to_check = array(
+			array( "name" => "PHP BCMath Extension", "type" => "f", "value" => "bcadd" ),
+		);
+		
         echo "<h3>".get_lang('checking_required_modules').":</h3>\n<table class='install'>";
 
         foreach ( $properties_to_check as $propertie ) {
-            if ( ( $propertie['type'] === "f" && function_exists($propertie['value']) ) ||
-                ( $propertie['type'] === "c" && class_exists($propertie['value']) ) ||
-				( $propertie['type'] === "x" && extension_loaded($propertie['value']) ) ) {
-                    echo "<tr><td>".$propertie['name']."</td>
-                        <td><span class='success'>".get_lang('found')."</span></td></tr>";
-                } else {
-                    echo "<tr><td>".$propertie['name']."</td>
-                        <td><span class='failure'>".get_lang('not_found')."</span></td></tr>";
-                    $failed = true;
-                }
+			if(preReqInstalled($propertie)){
+				echo "<tr><td>".$propertie['name']."</td><td><span class='success'>".get_lang('found')."</span></td></tr>";
+			}else{
+				echo "<tr><td>".$propertie['name']."</td><td><span class='failure'>".get_lang('not_found')."</span></td></tr>";
+				$failed = true;
+			}
         }
 
         echo "<tr><td>Pear XXTEA</td><td>";
@@ -325,6 +327,18 @@ function install() {
         echo "</td></tr>";
 
         echo "</table>\n";
+        
+        echo "<h3>".get_lang('checking_optional_modules').":</h3>\n<table class='install'>";
+        
+        foreach ( $optional_properties_to_check as $propertie ) {
+			if(preReqInstalled($propertie)){
+				echo "<tr><td>".$propertie['name']."</td><td><span class='success'>".get_lang('found')."</span></td></tr>";
+			}else{
+				echo "<tr><td>".$propertie['name']."</td><td><span class='warning'>".get_lang('not_found')."</span></td></tr>";
+			}
+        }
+		
+		echo "</table>\n";
 
         if ( $failed ) {
             echo "<p><a href='?'>".get_lang('refresh')."</a></p>\n";

+ 1 - 0
lang/English/install.php

@@ -34,6 +34,7 @@ define('OGP_LANG_not_found', "Not found");
 define('OGP_LANG_pear_xxtea_info', "Pear Crypt_XXTEA is required for OGP usage. In the most of the Linux distributions this module can be installed with the following Pear command 'pear install Crypt_XXTEA-beta'.");
 define('OGP_LANG_refresh', "Refresh");
 define('OGP_LANG_checking_required_modules', "Checking required modules");
+define('OGP_LANG_checking_optional_modules', "Checking optional modules");
 define('OGP_LANG_database_type', "Database type");
 define('OGP_LANG_database_settings', "Database access settings");
 define('OGP_LANG_database_hostname', "Database Hostname");