欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Joomla下利用configuration.php存儲簡單數(shù)據(jù)

 更新時間:2010年05月19日 23:45:34   作者:  
Joomla下利用configuration.php存儲簡單數(shù)據(jù)的代碼,需要的朋友可以參考下。
寫入過程
復制代碼 代碼如下:

// Get the path of the configuration file
$fname = JPATH_CONFIGURATION.DS.'configuration.php';
// clear cache
$cache = JFactory::getCache();
$cache->clean();
// Update the credentials with the new settings
$config =& JFactory::getConfig();
$config->setValue('config.custom_var', 'xxx');
// Get the config registry in PHP class format and write it to configuation.php
jimport('joomla.filesystem.file');
if (!JFile::write($fname, $config->toString('PHP', 'config', array('class' => 'JConfig')))) {
die(JText::_('ERRORCONFIGFILE'));
}

提取過程
復制代碼 代碼如下:

global $mainframe;
$mainframe->getCfg('custom_var');

相關(guān)文章

  • PHP擴展之kafka安裝應用案例詳解

    PHP擴展之kafka安裝應用案例詳解

    這篇文章主要介紹了PHP擴展之kafka安裝應用案例詳解,本篇文章通過簡要的案例,講解了該項技術(shù)的了解與使用,以下就是詳細內(nèi)容,需要的朋友可以參考下
    2021-09-09
  • php獲取系統(tǒng)變量方法小結(jié)

    php獲取系統(tǒng)變量方法小結(jié)

    這篇文章主要介紹了php獲取系統(tǒng)變量方法,實例總結(jié)了get_defined_vars、get_object_vars、phpinfo及phpversion等方法獲取系統(tǒng)信息的相關(guān)使用技巧,需要的朋友可以參考下
    2015-05-05
  • 最新評論