当前位置: 首页>>代码示例>>PHP>>正文


PHP Loader::config方法代码示例

本文整理汇总了PHP中Loader::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::config方法的具体用法?PHP Loader::config怎么用?PHP Loader::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Loader的用法示例。


在下文中一共展示了Loader::config方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createXml

 /**
  * 生成接口参数xml
  */
 function createXml()
 {
     try {
         //检测必填参数
         if ($this->parameters["out_trade_no"] == null && $this->parameters["transaction_id"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("退款申请接口中,out_trade_no、transaction_id至少填一个!" . "<br>");
         } elseif ($this->parameters["out_refund_no"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("退款申请接口中,缺少必填参数out_refund_no!" . "<br>");
         } elseif ($this->parameters["total_fee"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("退款申请接口中,缺少必填参数total_fee!" . "<br>");
         } elseif ($this->parameters["refund_fee"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("退款申请接口中,缺少必填参数refund_fee!" . "<br>");
         } elseif ($this->parameters["op_user_id"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("退款申请接口中,缺少必填参数op_user_id!" . "<br>");
         }
         $_settings = Loader::config('pay');
         $this->parameters["appid"] = $_settings['weixinpay']['virCardNoIn'];
         //公众账号ID
         $this->parameters["mch_id"] = $_settings['weixinpay']['p1_MerId'];
         //商户号
         $this->parameters["nonce_str"] = $this->createNoncestr();
         //随机字符串
         $this->parameters["sign"] = $this->getSign($this->parameters);
         //签名
         return $this->arrayToXml($this->parameters);
     } catch (Sp_Payment_Weixinpay_SDKRuntimeException $e) {
         die($e->errorMessage());
     }
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:32,代码来源:RefundPub.php

示例2: allConfig

 /**
  * function description
  * 
  * @param
  * @return void
  */
 public static function allConfig()
 {
     static $_settings = null;
     if ($_settings === null) {
         $_settings = Loader::config('pay');
     }
     return $_settings;
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:14,代码来源:Payment.php

示例3: allConfig

 /**
  * function description
  *
  * @param
  * @return void
  */
 public static function allConfig()
 {
     static $_settings = null;
     if ($_settings === null) {
         $_settings = Loader::config(self::CONFIG_NODE);
     }
     return $_settings;
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:14,代码来源:Queue.php

示例4: cache_cla

 /**
  * construct function
  */
 function cache_cla()
 {
     $this->config =& Loader::config();
     $engine = $this->config['cache_engine'];
     include_once LIBDIR . '/cache/' . $engine . '.php';
     $enginename = 'cache_' . $engine;
     $cache_policy = isset($this->config['cache_policy']) ? $this->config['cache_policy'] : array();
     $this->_cache = new $enginename($cache_policy);
 }
开发者ID:vluo,项目名称:myPoto,代码行数:12,代码来源:cache.class.php

示例5: getReqHmacString

 function getReqHmacString($version, $tranCode, $merchantID, $merOrderNum, $tranAmt, $feeAmt, $tranDateTime, $frontMerUrl, $backgroundMerUrl, $orderId, $gopayOutOrderId, $tranIP, $respCode, $gopayServerTime, $verficationCode)
 {
     $_settings = Loader::config('pay');
     if (!isset($_settings['gopay'])) {
         throw new Exception('payment node [gopay] not found');
         //return null;
     }
     $signStr = 'version=[' . $version . ']tranCode=[' . $tranCode . ']merchantID=[' . $merchantID . ']merOrderNum=[' . $merOrderNum . ']tranAmt=[' . $tranAmt . ']feeAmt=[' . $feeAmt . ']tranDateTime=[' . $tranDateTime . ']frontMerUrl=[' . $frontMerUrl . ']backgroundMerUrl=[' . $backgroundMerUrl . ']orderId=[' . $orderId . ']gopayOutOrderId=[' . $gopayOutOrderId . ']tranIP=[' . $tranIP . ']respCode=[' . $respCode . ']gopayServerTime=[' . $gopayServerTime . ']VerficationCode=[' . $verficationCode . ']';
     return md5($signStr);
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:10,代码来源:HttpClient.php

示例6: config

 /**
  * 加载配置信息
  * 
  * @param string $section
  * @return array
  */
 public static function config($section)
 {
     static $_settings = null;
     if ($_settings === null) {
         $_settings = Loader::config('search');
     }
     if (!isset($_settings[$section])) {
         return null;
     }
     return $_settings[$section];
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:17,代码来源:Searcher.php

示例7:

 public static function &get($type, $name = false)
 {
     if (!isset(self::$config[$type])) {
         self::$config[$type] = Loader::config($type);
     }
     if ($name) {
         return self::$config[$type][$name];
     } else {
         return self::$config[$type];
     }
 }
开发者ID:pgfeng,项目名称:GFPHP,代码行数:11,代码来源:Config.class.php

示例8: createXml

 /**
  * 	作用:设置标配的请求参数,生成签名,生成接口参数xml
  */
 function createXml()
 {
     $_settings = Loader::config('pay');
     $this->parameters["appid"] = $_settings['weixinpay']['virCardNoIn'];
     //公众账号ID
     $this->parameters["mch_id"] = $_settings['weixinpay']['p1_MerId'];
     //商户号
     $this->parameters["nonce_str"] = $this->createNoncestr();
     //随机字符串
     $this->parameters["sign"] = $this->getSign($this->parameters);
     //签名
     return $this->arrayToXml($this->parameters);
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:16,代码来源:WxpayClientPub.php

示例9: createXml

 /**
  * 生成接口参数xml
  */
 function createXml()
 {
     try {
         if ($this->parameters["long_url"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("短链接转换接口中,缺少必填参数long_url!" . "<br>");
         }
         $_settings = Loader::config('pay');
         $this->parameters["appid"] = $_settings['weixinpay']['virCardNoIn'];
         //公众账号ID
         $this->parameters["mch_id"] = $_settings['weixinpay']['p1_MerId'];
         //商户号
         $this->parameters["nonce_str"] = $this->createNoncestr();
         //随机字符串
         $this->parameters["sign"] = $this->getSign($this->parameters);
         //签名
         return $this->arrayToXml($this->parameters);
     } catch (Sp_Payment_Weixinpay_SDKRuntimeException $e) {
         die($e->errorMessage());
     }
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:23,代码来源:ShortUrlPub.php

示例10: checkCached

function checkCached($res, $priv, $ctl, $format)
{
    if ($format == 'html') {
        return 0;
    }
    $ac = Loader::config("admin.cache");
    if (isset($ac[$res]) && isset($ac[$res][$priv])) {
        $request = Request::current();
        $ret = $ac[$res][$priv];
        $str = '';
        if (isset($ret['params'])) {
            foreach (explode(',', $ret['params']) as $param) {
                $v = $request->{$param};
                if (!is_null($v)) {
                    $str .= $v;
                }
            }
        }
        $ret['cache_key'] = sprintf("dust_ac_%s_%s_%u_%s", strtolower($res), strtolower($priv), crc32($str), $request->format);
        return $ret;
    }
    return 0;
}
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:23,代码来源:index.php

示例11: getCallbackHmacString

 public static function getCallbackHmacString($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType)
 {
     //include 'merchantProperties.php';
     $_settings = Loader::config('pay');
     if (!isset($_settings['yeepay'])) {
         throw new Exception('payment node [yeepay] not found');
         //return null;
     }
     #取得加密前的字符串
     $sbOld = "";
     #加入商家ID
     $sbOld = $sbOld . $_settings['yeepay']['p1_MerId'];
     #加入消息类型
     $sbOld = $sbOld . $r0_Cmd;
     #加入业务返回码
     $sbOld = $sbOld . $r1_Code;
     #加入交易ID
     $sbOld = $sbOld . $r2_TrxId;
     #加入交易金额
     $sbOld = $sbOld . $r3_Amt;
     #加入货币单位
     $sbOld = $sbOld . $r4_Cur;
     #加入产品Id
     $sbOld = $sbOld . $r5_Pid;
     #加入订单ID
     $sbOld = $sbOld . $r6_Order;
     #加入用户ID
     $sbOld = $sbOld . $r7_Uid;
     #加入商家扩展信息
     $sbOld = $sbOld . $r8_MP;
     #加入交易结果返回类型
     $sbOld = $sbOld . $r9_BType;
     $merchantKey = $_settings['yeepay']['merchantKey'];
     //logstr($r6_Order,$sbOld,HmacMd5($sbOld,$merchantKey));
     return self::HmacMd5($sbOld, $merchantKey);
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:36,代码来源:Common.php

示例12: createLink

 /**
  * 生成Native支付链接二维码
  */
 function createLink()
 {
     try {
         if ($this->parameters["product_id"] == null) {
             throw new Sp_Payment_Weixinpay_SDKRuntimeException("缺少Native支付二维码链接必填参数product_id!" . "<br>");
         }
         $_settings = Loader::config('pay');
         $this->parameters["appid"] = $_settings['weixinpay']['virCardNoIn'];
         //公众账号ID
         $this->parameters["mch_id"] = $_settings['weixinpay']['p1_MerId'];
         //商户号
         $time_stamp = time();
         $this->parameters["time_stamp"] = "{$time_stamp}";
         //时间戳
         $this->parameters["nonce_str"] = $this->createNoncestr();
         //随机字符串
         $this->parameters["sign"] = $this->getSign($this->parameters);
         //签名
         $bizString = $this->formatBizQueryParaMap($this->parameters, false);
         $this->url = "weixin://wxpay/bizpayurl?" . $bizString;
     } catch (Sp_Payment_Weixinpay_SDKRuntimeException $e) {
         die($e->errorMessage());
     }
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:27,代码来源:NativeLinkPub.php

示例13: postXmlSSLCurl

 /**
  * 	作用:使用证书,以post方式提交xml到对应的接口url
  */
 function postXmlSSLCurl($xml, $url, $second = 30)
 {
     $ch = curl_init();
     //超时时间
     curl_setopt($ch, CURLOPT_TIMEOUT, $second);
     //这里设置代理,如果有的话
     //curl_setopt($ch,CURLOPT_PROXY, '8.8.8.8');
     //curl_setopt($ch,CURLOPT_PROXYPORT, 8080);
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
     //设置header
     curl_setopt($ch, CURLOPT_HEADER, FALSE);
     //要求结果为字符串且输出到屏幕上
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
     $_settings = Loader::config('pay');
     //设置证书
     //使用证书:cert 与 key 分别属于两个.pem文件
     //默认格式为PEM,可以注释
     curl_setopt($ch, CURLOPT_SSLCERTTYPE, 'PEM');
     curl_setopt($ch, CURLOPT_SSLCERT, $_settings['weixinpay']['sslcertPath']);
     //默认格式为PEM,可以注释
     curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM');
     curl_setopt($ch, CURLOPT_SSLKEY, $_settings['weixinpay']['sslkeyPath']);
     //post提交方式
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
     $data = curl_exec($ch);
     //返回结果
     if ($data) {
         curl_close($ch);
         return $data;
     } else {
         $error = curl_errno($ch);
         echo "curl出错,错误码:{$error}" . "<br>";
         echo "<a href='http://curl.haxx.se/libcurl/c/libcurl-errors.html'>错误原因查询</a></br>";
         curl_close($ch);
         return false;
     }
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:43,代码来源:Commonutilpub.php

示例14: getParameters

 /**
  * 	作用:设置jsapi的参数
  */
 public function getParameters()
 {
     $_settings = Loader::config('pay');
     $jsApiObj["appId"] = $_settings['weixinpay']['virCardNoIn'];
     //公众账号ID
     $timeStamp = time();
     $jsApiObj["timeStamp"] = "{$timeStamp}";
     $jsApiObj["nonceStr"] = $this->createNoncestr();
     $jsApiObj["package"] = "prepay_id={$this->prepay_id}";
     $jsApiObj["signType"] = "MD5";
     $jsApiObj["paySign"] = $this->getSign($jsApiObj);
     $this->parameters = json_encode($jsApiObj, false);
     return $this->parameters;
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:17,代码来源:JsApiPub.php

示例15: filtUserSet

 static function filtUserSet($user_id, $section, &$types)
 {
     $user_set = Sp_Message_Message::getMessageSet($user_id, $section);
     if ($user_set) {
         $user_set = current($user_set);
     } else {
         //加载默认设置
         $user_set = Loader::config('message');
         $user_set = $user_set[$section]['channel'];
     }
     if ($user_set['email'] == 0 or $user_set['email']['default'] == 0) {
         unset($types['email']);
     }
     if ($user_set['sms'] == 0 or $user_set['sms']['default'] == 0) {
         unset($types['sms']);
     }
     if ($user_set['mess'] == 0 or $user_set['mess']['default'] == 0) {
         unset($types['mess']);
     }
     unset($types['ischeckuser']);
 }
开发者ID:ahmatjan,项目名称:Scene-Editor-for-mobile,代码行数:21,代码来源:Message.php


注:本文中的Loader::config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。