用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3261|回复: 2
收起左侧

CI 配置文件格式问题

[复制链接]
发表于 2014-6-7 16:57:42 | 显示全部楼层 |阅读模式
支付宝接口开发中,使用了论坛的帖子,alipay.php的配置文件格式如下

//签名方式 不需修改
$alipay_config['sign_type']    = strtoupper('MD5');

//字符编码格式 目前支持 gbk 或 utf-8
$alipay_config['input_charset']= strtolower('utf-8');

//ca证书路径地址,用于curl中ssl校验
//请保证cacert.pem文件在当前文件夹目录中
$alipay_config['cacert']    = getcwd().'\\cacert.pem';

//访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
$alipay_config['transport']    = 'http';

在 使用时使用如下方法
$this->config->load('alipay', TRUE);

$alipay_cnf = $this->config->item('alipay');
产生如下错误

An Error Was Encountered

Your application/lulubao/config/alipay.php file does not appear to contain a valid configuration array.


是不是配置文件里只能写这样格式的
$config['cacert']=""

发表于 2014-6-11 10:02:44 | 显示全部楼层
对 只能那样的格式的
发表于 2014-6-11 10:03:30 | 显示全部楼层
你可以这样啊
PHP复制代码
$config['zhifubao'] = $alipay_config ;
复制代码

本版积分规则