本文整理汇总了PHP中kernel::api_url方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::api_url方法的具体用法?PHP kernel::api_url怎么用?PHP kernel::api_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kernel
的用法示例。
在下文中一共展示了kernel::api_url方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($app)
{
parent::__construct($app);
//$this->callback_url = $this->app->base_url(true)."/apps/".basename(dirname(__FILE__))."/".basename(__FILE__);
$this->callback_url = kernel::api_url('api.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_alipay', 'callback');
$this->submit_url = 'https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8';
$this->submit_method = 'POST';
$this->submit_charset = 'utf-8';
}
示例2: __construct
public function __construct($app)
{
parent::__construct($app);
$this->callback_url = kernel::api_url('api.ectools_payment/parse/' . $this->app->app_id . '/ectools_payment_plugin_paypal', 'callback');
$this->callback_url = str_replace("//", "/", $this->callback_url);
$this->submit_url = 'https://www.paypal.com/cgi-bin/webscr';
$this->submit_method = 'POST';
$this->submit_charset = 'utf-8';
}
示例3: runtask
function runtask($task_id)
{
$http = kernel::single('base_httpclient');
$_POST['task_id'] = $task_id;
$url = kernel::api_url('api.queue', 'worker', array('task_id' => $task_id));
kernel::log('Spawn [Task-' . $task_id . '] ' . $url);
//99%概率不会有问题
$http->hostaddr = $_SERVER["SERVER_ADDR"] ? $_SERVER["SERVER_ADDR"] : '127.0.0.1';
$http->hostport = $_SERVER["SERVER_PORT"] ? $_SERVER["SERVER_PORT"] : '80';
$ret = $http->post($url, $_POST, null, null, true);
}
示例4: call
public function call($method, $params)
{
$rpc_id = $this->begin_transaction($method, $params);
$headers = array('Connection' => $this->timeout);
$query_params = array('app_id' => 'ecos.' . $this->app->app_id, 'method' => $method, 'date' => date('Y-m-d H:i:s'), 'callback_url' => kernel::api_url('api.rpc_callback', 'async_result_handler', array('id' => $rpc_id)), 'format' => 'json', 'certi_id' => base_certificate::certi_id(), 'v' => $this->api_version($method), 'from_node_id' => base_shopnode::node_id($this->app->app_id));
$query_params['node_id'] = $params['to_node_id'];
$query_params = array_merge((array) $params, $query_params);
$query_params['sign'] = base_certificate::gen_sign($query_params);
$url = $this->get_url($this->network_id);
$core_http = kernel::single('base_httpclient');
$response = $core_http->post($url, $query_params, $headers);
if ($response === HTTP_TIME_OUT) {
$headers = $core_http->responseHeader;
kernel::log('Request timeout, process-id is ' . $headers['process-id']);
app::get('base')->model('rpcpoll')->update(array('process_id' => $headers['process-id']), array('id' => $rpc_id, 'type' => 'request'));
$this->status = RPC_RST_RUNNING;
return false;
} else {
kernel::log('Response: ' . $response);
$result = json_decode($response);
if ($result) {
$this->error = $response->error;
switch ($result->rst) {
case 'running':
$this->status = RPC_RST_RUNNING;
return false;
case 'succ':
app::get('base')->model('rpcpoll')->delete(array('id' => $rpc_id, 'type' => 'request'));
$this->status = RPC_RST_FINISH;
$method = $this->callback_method;
kernel::single($this->callback_class)->{$method}($result->data);
return $result->data;
case 'fail':
$this->error = 'Bad response';
$this->status = RPC_RST_ERROR;
return false;
}
} else {
//error 解码失败
}
}
}
示例5: column_editbutton
public function column_editbutton($row)
{
$callback_url = urlencode(kernel::api_url('api.b2c.callback.shoprelation', 'callback', array('shop_id' => $row['shop_id'])));
$api_url = kernel::base_url(1) . kernel::url_prefix() . '/api';
$str_operation = "";
if ($row['status'] == 'unbind') {
$str_operation = '<a href="index.php?app=b2c&ctl=admin_shoprelation&act=showEdit&p[0]=' . $row['shop_id'] . '" target="_blank">编辑</a>';
if ($str_operation) {
$str_operation .= ' <a href="index.php?ctl=shoprelation&act=index&p[0]=apply&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '">申请绑定</a>';
} else {
$str_operation .= '<a href="index.php?ctl=shoprelation&act=index&p[0]=apply&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '&p[3]=' . $api_url . '">申请绑定</a>';
}
} else {
$str_operation = '';
if ($str_operation) {
$str_operation .= ' <a href="index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '">解除绑定</a>';
} else {
$str_operation .= '<a href="index.php?ctl=shoprelation&act=index&p[0]=accept&p[1]=' . $this->app->app_id . '&p[2]=' . $callback_url . '">解除绑定</a>';
}
}
return $str_operation;
}
示例6: get_callback_url
function get_callback_url($module)
{
return kernel::api_url('api.pam_callback', 'login', array('module' => $module, 'type' => $this->type, 'redirect' => $this->redirect_url));
}