ecshop CFG 全域性引數配置檔案

2021-06-20 15:58:59 字數 3820 閱讀 5903

全域性引數配置的靜態檔案是 「/tmp/static_caches/shop_config.php」

所有引數在資料庫表 「ecs_shop_config」

**操作函式是 /include/lib_common.php 裡的函式  load_config()。

操作過程是 先判斷快取靜態檔案是否存在內容,如果有內容,直接讀取內容,如果是空資料,則去資料庫查詢所有的配置資訊,然後賦值給陣列,快取到shop_config.php檔案中,減少對資料庫的頻繁讀取,減少效能瓶頸。

附:操作函式:

/**

* 載入配置資訊

* * @access public

* @return array

*/function load_config()

/* 對數值型設定處理 */

$arr['watermark_alpha'] = intval($arr['watermark_alpha']);

$arr['market_price_rate'] = floatval($arr['market_price_rate']);

$arr['integral_scale'] = floatval($arr['integral_scale']);

//$arr['integral_percent'] = floatval($arr['integral_percent']);

$arr['cache_time'] = intval($arr['cache_time']);

$arr['thumb_width'] = intval($arr['thumb_width']);

$arr['thumb_height'] = intval($arr['thumb_height']);

$arr['image_width'] = intval($arr['image_width']);

$arr['image_height'] = intval($arr['image_height']);

$arr['best_number'] = !empty($arr['best_number']) && intval($arr['best_number']) > 0 ? intval($arr['best_number']) : 3;

$arr['new_number'] = !empty($arr['new_number']) && intval($arr['new_number']) > 0 ? intval($arr['new_number']) : 3;

$arr['hot_number'] = !empty($arr['hot_number']) && intval($arr['hot_number']) > 0 ? intval($arr['hot_number']) : 3;

$arr['promote_number'] = !empty($arr['promote_number']) && intval($arr['promote_number']) > 0 ? intval($arr['promote_number']) : 3;

$arr['top_number'] = intval($arr['top_number']) > 0 ? intval($arr['top_number']) : 10;

$arr['history_number'] = intval($arr['history_number']) > 0 ? intval($arr['history_number']) : 5;

$arr['comments_number'] = intval($arr['comments_number']) > 0 ? intval($arr['comments_number']) : 5;

$arr['article_number'] = intval($arr['article_number']) > 0 ? intval($arr['article_number']) : 5;

$arr['page_size'] = intval($arr['page_size']) > 0 ? intval($arr['page_size']) : 10;

$arr['bought_goods'] = intval($arr['bought_goods']);

$arr['goods_name_length'] = intval($arr['goods_name_length']);

$arr['top10_time'] = intval($arr['top10_time']);

$arr['goods_gallery_number'] = intval($arr['goods_gallery_number']) ? intval($arr['goods_gallery_number']) : 10;

$arr['no_picture'] = !empty($arr['no_picture']) ? str_replace('../', './', $arr['no_picture']) : 'images/no_picture.gif'; // 修改預設商品的路徑

$arr['qq'] = !empty($arr['qq']) ? $arr['qq'] : '';

$arr['ww'] = !empty($arr['ww']) ? $arr['ww'] : '';

$arr['default_storage'] = isset($arr['default_storage']) ? intval($arr['default_storage']) : 1;

$arr['min_goods_amount'] = isset($arr['min_goods_amount']) ? floatval($arr['min_goods_amount']) : 0;

$arr['one_step_buy'] = empty($arr['one_step_buy']) ? 0 : 1;

$arr['invoice_type'] = empty($arr['invoice_type']) ? array('type' => array(), 'rate' => array()) : unserialize($arr['invoice_type']);

$arr['show_order_type'] = isset($arr['show_order_type']) ? $arr['show_order_type'] : 0; // 顯示方式預設為列表方式

$arr['help_open'] = isset($arr['help_open']) ? $arr['help_open'] : 1; // 顯示方式預設為列表方式

if (!isset($globals['_cfg']['ecs_version']))

//限定語言項

$lang_array = array('zh_cn', 'zh_tw', 'en_us');

if (empty($arr['lang']) || !in_array($arr['lang'], $lang_array))

if (empty($arr['integrate_code']))

write_static_cache('shop_config', $arr);

}else

return $arr;

}

Axios 請求配置引數詳解以及全域性配置示例

傳送 post 請求 axios transformresponse 在傳遞給 then catch 前,允許修改響應資料 transformresponse function data headers 是即將被傳送的自定義請求頭 headers params 是即將與請求一起傳送的 url 引數 ...

sql server 全域性引數

1 identity 返回最後插入的標識值。這個變數很有用,當你插入一行資料時,想同時獲得該行的的id 標示列 就可以用 identity 示例 下面的示例向帶有標識列的表中插入一行,並用 identity 顯示在新行中使用的標識值。insert into jobs job desc,min lvl...

Keepalived全域性配置

包括兩個子配置 全域性定義,global definition 靜態位址路由,static ipaddress routes 主要設定keepalived的通知機制和標識 global defs notification email from admin example.com smtp serve...