Index: trunk/xpressme_integration_kit/class/config_from_xoops.class.php
===================================================================
--- trunk/xpressme_integration_kit/class/config_from_xoops.class.php	(revision 657)
+++ trunk/xpressme_integration_kit/class/config_from_xoops.class.php	(revision 669)
@@ -45,4 +45,7 @@
 	var $module_config= array();
 	var $xoops_time_zone;
+	var $xoops_var_path;
+	var $xoops_db_charset;
+	var $xoops_db_pconnect;
 	
 	function __constructor()	//for PHP5
@@ -81,4 +84,13 @@
 			if(file_exists($this->xoops_mainfile_path)){
     			$this->_get_value_by_xoops_mainfile();
+    			
+    			// Xoops2.5 secure.php 
+				if (!empty($this->xoops_var_path)){
+					$secure_path = $this->xoops_var_path . "/data/secure.php";
+    				if (file_exists($secure_path)){
+    					$this->_get_value_by_xoops_secure($secure_path);
+    				}
+				}
+
     			// Value 'is_impress' and value 'external_define_path' used in the under
     			// are set in _get_value_by_xoops_mainfile(). 
@@ -150,4 +162,7 @@
 						$this->xoops_salt = $this->xpress_eval($key_value);
 						break;
+					case  'XOOPS_VAR_PATH':
+						$this->xoops_var_path = $this->xpress_eval($key_value);
+						break;
 					default :
 						
@@ -167,4 +182,52 @@
 				$this->impress_db_config_file = $this->xoops_trust_path . $impres_matchs[2];
 			}
+		} // end of for loop		
+	}
+	// A set value is acquired from XOOPS mainfile.php by the pattern match.
+	function _get_value_by_xoops_secure($secure_path){
+		$array_file = file($secure_path);
+		$pattern = '^\s*define\s*\(\s*(\'[^\']+\'|"[^"]+")\s*,\s*([^\s]+.*)\s*\)\s*;';
+		$impress_include_pattern = '^\s*(include_once|include)\s*\(\s*XOOPS_TRUST_PATH\s*.\s*[\'"]([^\'"]+)[\'"]\s*\)';
+		$external_define_file_pattern = '^\s*(include_once|include|require_once|require_once)\s*\((.*mainfile\.php.*)\)';
+		for ($i = 0 ; $i <count($array_file) ; $i++){
+			if (preg_match('/' . $pattern . '/' ,$array_file[$i],$matchs)){
+				$keys = $matchs[1];
+				if (preg_match('/^\'[^\']*\'$/',$keys)) $keys = preg_replace('/\'/', '', $keys);
+				if (preg_match('/^"[^"]*"$/',$keys)) $keys = preg_replace('/"/', '', $keys);
+				$key_value = $matchs[2];
+
+				switch ($keys){
+					case  'XOOPS_DB_PREFIX':
+						$this->xoops_db_prefix = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_NAME':
+						$this->xoops_db_name = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_USER':
+						$this->xoops_db_user = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_PASS':
+						$this->xoops_db_pass = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_HOST':
+						$this->xoops_db_host = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_SALT':
+						$this->xoops_db_salt = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_SALT':
+						$this->xoops_salt = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_CHARSET':
+						$this->xoops_db_charset = $this->xpress_eval($key_value);
+						break;
+					case  'XOOPS_DB_PCONNECT':
+						$this->xoops_db_pconnect = $this->xpress_eval($key_value);
+						break;
+					default :
+						
+				}	// end of switch
+			}	 // end of if preg_match
+			
 		} // end of for loop		
 	}
