ZenCart系统里面使用的常量有两种类型,一种是文件定义的常量,另一种是数据库里面定义的常量。
$use_cache = (isset($_GET['nocache']) ? false : true ) ;$configuration = $db->Execute('select configuration_key as cfgkey, configuration_value as cfgvalue from ' . TABLE_CONFIGURATION, '', $use_cache, 150); while (!$configuration->EOF) { /** * dynamic define based on info read from DB */ define(strtoupper($configuration->fields['cfgkey']), $configuration->fields['cfgvalue']);///定义数据库常量 $configuration->MoveNext();}$configuration = $db->Execute('select configuration_key as cfgkey, configuration_value as cfgvalue from ' . TABLE_PRODUCT_TYPE_LAYOUT);while (!$configuration->EOF) { /** * dynamic define based on info read from DB * @ignore */ define(strtoupper($configuration->fields['cfgkey']), $configuration->fields['cfgvalue']);//定义数据库常量 $configuration->movenext();}
这个文件是在初始化的时候执行了,所以在系统里面可以直接使用数据库里面的常量来取得他的值。比如STORE_NAME。 |


淘中国代购网站程序源码
人气:1450
shopex麦包包模板|麦包包模
人气:476
ecshop转盘积分抽奖插件
人气:7377
ecshop蔬菜水果商城程序模
人气:2469
Printshop 印刷业通用magent
人气:104
ecshop仿优优康保健品商城
人气:433