XPressME Integration Kit

Trac

Changeset 785


Ignore:
Timestamp:
May 30, 2011, 11:39:07 AM (13 years ago)
Author:
toemon
Message:

XOOPS Engine でのdb_prefix取得バグ修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/class/wpConfigInfo_class.php

    r783 r785  
    3030    { 
    3131                global $xoopsModule; 
    32                 $this->xoops_db_prefix = XOOPS_DB_PREFIX .'_'; 
    33                 $this->db_prefix = $this->_get_wp_db_prefix(); 
     32                $this->xoops_db_prefix = XOOPS_DB_PREFIX . '_'; 
    3433                $this->db_name = XOOPS_DB_NAME; 
    3534                $this->db_user = XOOPS_DB_USER; 
     
    3736                $this->db_host = XOOPS_DB_HOST; 
    3837                if(!defined('XOOPS_DB_NAME') ) $this->_get_resource_db_ini(); 
     38                $this->db_prefix = $this->_get_wp_db_prefix(); 
    3939                $this->db_salt = (defined('XOOPS_DB_SALT')) ? XOOPS_DB_SALT : ''; 
    4040                require_once dirname( __FILE__ ).'/langInfo_class.php' ; 
     
    4343        function _get_wp_db_prefix(){ 
    4444                $module_name = basename(dirname(dirname(__FILE__))); 
    45         $module_db_prefix = XOOPS_DB_PREFIX . '_' . preg_replace('/wordpress/','wp',$module_name) . '_'; 
     45        $module_db_prefix = $this->xoops_db_prefix . preg_replace('/wordpress/','wp',$module_name) . '_'; 
    4646        return $module_db_prefix; 
    4747        } 
     
    6363                                $this->db_pass = $matchs[1]; 
    6464                        if (preg_match('/^\s*prefix\s*=\s*[\'"](.*)[\'"]/' ,$line,$matchs)) 
    65                                 $this->db_prefix = $matchs[1]; 
     65                                $this->xoops_db_prefix = $matchs[1].'_'; 
    6666                } 
    6767        } 
     
    7070                return $this->xoops_db_prefix; 
    7171        } 
    72         function get_db_prefix(){ 
    73                 return $this->db_prefix; 
     72        function get_db_prefix($module_dirname){ 
     73                if (empty($module_dirname)){ 
     74                        return $this->db_prefix; 
     75                } else { 
     76                $module_db_prefix = $this->xoops_db_prefix . preg_replace('/wordpress/','wp',$module_dirname) . '_'; 
     77                return $module_db_prefix;                
     78                } 
    7479        } 
    7580        function get_wp_db_prefix(){ 
Note: See TracChangeset for help on using the changeset viewer.