/** * calculate the final config */ protected function calCfg() { /* include custom config */ require_once MBQ_CUSTOM_PATH . 'commonConfig.php'; if (MbqMain::isXmlRpcProtocol() || MbqMain::isJsonProtocol() || MbqMain::isRawPostProtocol()) { require_once MBQ_CUSTOM_PATH . 'customConfig.php'; } elseif (MbqMain::isAdvJsonProtocol()) { require_once MBQ_CUSTOM_PATH . 'customAdvConfig.php'; } else { MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . "Invalid protocol."); } /* replace part config through MbqMain::$customConfig */ foreach (MbqMain::$customConfig as $moduleKey => $module) { if (isset($this->cfg[$moduleKey])) { foreach ($module as $itemKey => $item) { if (isset($this->cfg[$moduleKey][$itemKey])) { $this->cfg[$moduleKey][$itemKey]->setOriValue($item); } else { MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . "Can not find module:{$moduleKey},item:{$itemKey} in config!"); } } } else { MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . "Can not find module:{$moduleKey} in config!"); } } }