dedecms織夢系統(tǒng)$globals定義文件在哪

字號:


    dedecms數(shù)據(jù)庫的信息是寫在data/common.inc.php,而系統(tǒng)連接數(shù)據(jù)庫時使用的有一個函數(shù)是:
    代碼如下:
    function init($pconnect=false) {
    $this->linkid = 0;
    $this->dbhost = $globals['cfg_dbhost']; //$globals在哪把信息放入$globals的?
    $this->dbuser = $globals['cfg_dbuser'];
    $this->dbpwd = $globals['cfg_dbpwd'];
    $this->dbname = $globals['cfg_dbname'];
    $this->dbprefix = $globals['cfg_dbprefix'];
    $this->result[me] = 0;
    $this->open($pconnect);
    }
    它是在哪把信息放入$globals中的?
    回復(fù):
    $globals 是全局變量數(shù)組
    凡是在函數(shù)和類以外定義的變量都在其中出現(xiàn)
    比如 $globals['cfg_dbhost'] 就在 common.inc.php 中有 $cfg_dbhost = '~dbhost~';
    當(dāng)加載 common.inc.php 后就有 $globals['cfg_dbhost']