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


PHP kernel::request方法代码示例

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


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

示例1: run

 function run($params = array())
 {
     $this->check_params = $params;
     $return = array();
     $totalScore = 0;
     $allow_install = true;
     $func_prefix = ECAE_MODE ? 'ecae_' : 'test_';
     foreach (get_class_methods($this) as $func) {
         if (substr($func, 0, 5) == $func_prefix) {
             $score = 0;
             $result = $this->{$func}($score);
             if ($result['items']) {
                 $group[$result['group']]['type'] = $result['type'];
                 $group[$result['group']]['items'] = array_merge($group[$result['group']['items']] ? $group[$result['group']['items']] : array(), $result['items']);
                 if ($allow_install && isset($result['allow_install'])) {
                     $allow_install = $result['allow_install'];
                 }
                 if ($result['key']) {
                     $return[$result['key']] =& $group[$result['group']]['items'];
                 }
             }
             $totalScore += $score;
         }
     }
     $score = floor($totalScore / 100) + 1;
     $rank = min($score, $this->maxLevel + 1);
     $level = array('E', 'D', 'C', 'B', 'A', 'S');
     $return['data'] = $group;
     $return['score'] = $totalScore;
     $return['level'] = $level[$rank - 1];
     $return['rank'] = $rank;
     $return['allow_install'] = $allow_install;
     $return['path_info'] = kernel::request()->get_path_info();
     return $return;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:35,代码来源:serverinfo.php

示例2: end

 public static function end($source = null)
 {
     if (!self::isExtension()) {
         die("没有xhprof扩展!");
     }
     // 可以return掉 则不影响正常程序
     $xhprof_data = xhprof_disable();
     $oXHProf = app::get("serveradm")->model("xhprof");
     //$run_id = $oXHProf->write_data($xhprof_data);
     include_once dirname(__FILE__) . "/../vendor/xhprof_lib/utils/xhprof_lib.php";
     include_once dirname(__FILE__) . "/../vendor/xhprof_lib/utils/xhprof_runs.php";
     $xhprof_runs = new XHProfRuns_Default();
     $run_id = $xhprof_runs->save_run($xhprof_data, "xhprof");
     $aData = array('source' => 'xhprof', 'run_id' => $run_id, 'request_uri' => kernel::request()->get_request_uri(), 'app' => $_GET['app'], 'ctl' => $_GET['ctl'], 'act' => $_GET['act'], 'wt' => $xhprof_data["main()"]["wt"], 'mu' => $xhprof_data["main()"]["mu"], 'pmu' => $xhprof_data["main()"]["pmu"], 'addtime' => time());
     $oXHProf->save($aData);
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:16,代码来源:xhprof.php

示例3: index

 public function index()
 {
     $this->_response->set_header('Cache-Control', 'no-store');
     $_index = $this->_request->get_param(0);
     $o_sitemaps = base_kvstore::instance('site_sitemaps');
     $o_sitemaps->fetch($_index, $arr);
     if (empty($arr)) {
         kernel::single('site_router')->http_status(404);
         return;
     } else {
         $this->pagedata['sitemaps'] = $arr;
         $this->pagedata['base_url'] = kernel::request()->get_port() == 443 ? str_replace('http', 'https', $this->app->res_url) : $this->app->res_url;
         $this->_response->set_header('Content-type', ' application/xml');
         $this->page('sitemaps/index.xml', true);
     }
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:16,代码来源:sitemaps.php

示例4: dispatch

 function dispatch($query)
 {
     $query_args = explode('/', $query);
     $action = array_shift($query_args);
     $action = $action ? $action : 'index';
     $params = $query_args;
     $controller = $this->app->controller('default');
     kernel::request()->set_params($params);
     if (!in_array($action, get_class_methods($controller))) {
         die('not good really');
     }
     if (is_array($params)) {
         call_user_func_array(array($controller, $action), $params);
     } else {
         $controller->{$action}();
     }
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:17,代码来源:router.php

示例5: dispatch

 function dispatch($query)
 {
     $query_args = explode('/', $query);
     $controller = array_shift($query_args);
     $action = array_shift($query_args);
     if ($controller == 'index.php') {
         $controller = '';
     }
     foreach ($query_args as $i => $v) {
         if ($i % 2) {
             $k = $v;
         } else {
             $params[$k] = $v;
         }
     }
     $controller = $controller ? $controller : 'default';
     $action = $action ? $action : 'index';
     $controller = $this->app->controller($controller);
     kernel::request()->set_params($params);
     $controller->{$action}();
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:21,代码来源:router.php

示例6: gen_id

 private function gen_id()
 {
     return md5(kernel::request()->get_request_uri());
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:4,代码来源:xhprof.php

示例7: __construct

 function __construct(&$app)
 {
     $this->app = $app;
     $this->params = kernel::request()->request_params;
     $this->pagedata =& base_render::$_vars;
 }
开发者ID:sss201413,项目名称:ecstore,代码行数:6,代码来源:render.php

示例8: dopay

 /**
  * 提交支付信息的接口
  * @param array 提交信息的数组
  * @return mixed false or null
  */
 public function dopay($payment)
 {
     $return_url = strtolower(kernel::request()->get_schema() . '://' . kernel::request()->get_host()) . app::get('wap')->router()->gen_url(array('app' => 'b2c', 'ctl' => 'wap_paycenter', 'act' => 'result_pay', 'args' => array($payment['payment_id'])));
     $this->callback_url = $return_url;
     $mer_id = trim($this->getConf('mer_id', __CLASS__));
     $mer_key = trim($this->getConf('mer_key', __CLASS__));
     $seller_account_name = trim($this->getConf('seller_account_name', __CLASS__));
     $subject = isset($payment['subject']) && $payment['subject'] ? $payment['subject'] : $payment['account'] . $payment['payment_id'];
     $subject = str_replace("'", '`', trim($subject));
     $subject = str_replace('"', '`', $subject);
     $subject = str_replace(' ', '', $subject);
     $merchant_url = '';
     $subject_tmp = $subject;
     $price = number_format($payment['cur_money'], 2, ".", "");
     $pms_0 = array("_input_charset" => $this->_input_charset_GBK, "sign_type" => $this->sec_id, "service" => $this->Service_Paychannel, "partner" => $mer_id, "out_user" => '');
     $result = $this->mobile_merchant_paychannel($pms_0, $mer_key);
     // if($result != "验签失败"){
     // 调用alipay_wap_trade_create_direct接口,并返回token返回参数
     $pms_1 = array("req_data" => '<direct_trade_create_req><subject>' . $subject_tmp . '</subject><out_trade_no>' . $payment['payment_id'] . '</out_trade_no><total_fee>' . $price . "</total_fee><seller_account_name>" . $seller_account_name . "</seller_account_name><notify_url>" . $this->notify_url . "</notify_url><out_user>" . '' . "</out_user><merchant_url>" . $merchant_url . "</merchant_url><cashier_code>" . '' . "</cashier_code>" . "<call_back_url>" . $this->callback_url . "</call_back_url></direct_trade_create_req>", "service" => $this->Service1, "sec_id" => $this->sec_id, "partner" => $mer_id, "req_id" => date("Ymdhis"), "format" => $this->format, "v" => $this->v);
     $token = $this->alipay_wap_trade_create_direct($pms_1, $mer_key);
     // if($token != '签名不正确'){
     // 验证和发送信息与跳转手机支付宝收银台.
     $req_data = '<auth_and_execute_req><request_token>' . $token . '</request_token></auth_and_execute_req>';
     $pms2 = array("req_data" => $req_data, "service" => $this->Service2, "sec_id" => $this->sec_id, "partner" => $mer_id, "call_back_url" => $this->callback_url, "format" => $this->format, "v" => $this->v);
     $parameter = $this->para_filter($pms2);
     $mysign = $this->build_mysign($this->arg_sort($parameter), $mer_key, $this->sec_id);
     $this->add_field('req_data', $req_data);
     $this->add_field('service', $this->Service2);
     $this->add_field('sec_id', $this->sec_id);
     $this->add_field('partner', $mer_id);
     $this->add_field('call_back_url', $this->callback_url);
     $this->add_field('format', $this->format);
     $this->add_field('v', $this->v);
     $this->add_field('sign', urlencode($mysign));
     $payhtml = $this->get_html();
     $date = date('Y-m-d');
     $file = 'payment/pay' . $payment['payment_id'] . '.html';
     $fh = fopen($file, 'w');
     fwrite($fh, $payhtml);
     fclose($fh);
     return 'http://pinzhen.qsit.com.cn/' . $file;
     exit;
     //     }else{
     //         echo '签名不正确';
     //         return false;
     //     }
     // }else{
     //     return false;
     // }
 }
开发者ID:noikiy,项目名称:Ecstore-to-odoo,代码行数:55,代码来源:malipay.php

示例9: parse


//.........这里部分代码省略.........
     $arrQueryStrs = array();
     // QUERY_STRING
     if (isset($arr_pathInfo[1]) && $arr_pathInfo[1]) {
         $querystring = $arr_pathInfo[1];
     }
     if ($querystring) {
         $arrStr = explode("&", $querystring);
         foreach ($arrStr as $str) {
             $arrSplits = explode("=", $str);
             $arrQueryStrs[urldecode($arrSplits[0])] = urldecode($arrSplits[1]);
         }
     } else {
         if ($_POST) {
             $arrQueryStrs = $_POST;
         }
     }
     $payments_bill = new $class_name($objShopApp);
     $ret = $payments_bill->{$method}($arrQueryStrs);
     // 支付结束,回调服务.
     if (!isset($ret['status']) || $ret['status'] == '') {
         $ret['status'] = 'failed';
     }
     $obj_payments = app::get('ectools')->model('payments');
     $sdf = $obj_payments->dump($ret['payment_id'], '*', '*');
     if ($sdf) {
         $sdf['account'] = $ret['account'];
         $sdf['bank'] = $ret['bank'];
         $sdf['pay_account'] = $ret['pay_account'];
         $sdf['currency'] = $ret['currency'];
         $sdf['trade_no'] = $ret['trade_no'];
         $sdf['t_payed'] = $ret['t_payed'];
         $sdf['pay_app_id'] = $ret['pay_app_id'];
         $sdf['pay_type'] = $ret['pay_type'];
         $sdf['memo'] = $ret['memo'];
     }
     switch ($ret['status']) {
         case 'succ':
         case 'progress':
             if ($sdf && $sdf['status'] != 'succ') {
                 $is_updated = false;
                 $obj_payment_update = kernel::single('ectools_payment_update');
                 $is_updated = $obj_payment_update->generate($ret, $msg);
                 $obj_pay_lists = kernel::servicelist("order.pay_finish");
                 foreach ($obj_pay_lists as $order_pay_service_object) {
                     // 防止重复充值
                     if ($is_updated) {
                         $db = kernel::database();
                         $transaction_status = $db->beginTransaction();
                         $is_updated = $order_pay_service_object->order_pay_finish($sdf, $ret['status'], 'font', $msg);
                         if (!$is_updated) {
                             kernel::log(app::get('ectools')->_('支付失败') . " " . $msg . "\n");
                             $db->rollback();
                         } else {
                             $db->commit($transaction_status);
                             // 支付扩展事宜 - 如果上面与中心没有发生交互,那么此处会发出和中心交互事宜.
                             if (method_exists($order_pay_service_object, 'order_pay_finish_extends')) {
                                 $order_pay_service_object->order_pay_finish_extends($sdf);
                             }
                         }
                     }
                 }
                 //支付成功给支付网关显示支付信息
                 if (method_exists($payments_bill, 'ret_result')) {
                     $payments_bill->ret_result($ret['payment_id']);
                 }
             }
             break;
         case 'REFUND_SUCCESS':
             // 退款成功操作
             if ($sdf) {
                 unset($sdf['payment_id']);
                 $obj_refund = app::get('ectools')->model('refund');
                 $sdf['refund_id'] = $obj_refund->gen_id();
                 $ret['status'] = 'succ';
                 if ($obj_refund->insert($sdf)) {
                     //处理单据的支付状态
                     $obj_refund_finish = kernel::service("order.refund_finish");
                     $obj_refund_finish->order_refund_finish($sdf, $ret['status'], 'font', $msg);
                 }
             }
             break;
         case 'PAY_PDT_SUCC':
             $ret['status'] = 'succ';
             // 无需更新状态.
             break;
         case 'failed':
         case 'error':
         case 'cancel':
         case 'invalid':
         case 'timeout':
             $is_updated = false;
             $obj_payment_update = kernel::single('ectools_payment_update');
             $is_updated = $obj_payment_update->generate($ret, $msg);
             break;
     }
     // Redirect page.
     if ($sdf['return_url']) {
         header('Location: ' . strtolower(kernel::request()->get_schema() . '://' . kernel::request()->get_host()) . $sdf['return_url']);
     }
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:101,代码来源:api.php


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