/** * 给param赋值的方法 * * @param BaseParam $param */ public function setParam(BaseParam &$param) { foreach ($this->params as $key => $value) { $method = String::convertKeyToFuncName($key); if (method_exists($param, $method)) { call_user_func_array(array($param, $method), array($value)); } } Logger::addInfo('alipay_wap_handler_base', 'setParam', array('res' => (string) $param)); }
/** * @return Config */ public function getConfig() { $config = new Config(); $tmp = (include "{$this->config_file_path}"); Logger::addInfo('alipay_wap_handler_phpfileconfig', 'load the confing array', array('config_file_path' => $this->config_file_path, 'config_array' => $tmp)); foreach ($tmp as $key => $val) { $method = String::convertKeyToFuncName($key); if (method_exists($config, $method)) { call_user_func_array(array($config, $method), array($val)); } //$config->$key = $val; } return $config; }