本文整理匯總了PHP中Facebook::current_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP Facebook::current_url方法的具體用法?PHP Facebook::current_url怎麽用?PHP Facebook::current_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Facebook
的用法示例。
在下文中一共展示了Facebook::current_url方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_extended_permission_url
/**
* support both prompt_permissions.php and authorize.php for now.
* authorized.php is to be deprecate though.
*/
public function get_extended_permission_url($ext_perm, $next = null, $cancel_url = null)
{
$next = $next ? $next : parent::current_url();
$cancel_url = $cancel_url ? $cancel_url : parent::current_url();
return $this->get_m_url('authorize.php', array('api_key' => $this->api_key, 'ext_perm' => $ext_perm, 'next' => $next, 'cancel_url' => $cancel_url));
}
示例2: testNetworkRedirect
public function testNetworkRedirect()
{
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['REQUEST_URI'] = '/web/url';
$params = array('soc_session_key' => '', 'session_key' => 'session-key', 'user' => '10000', 'in_iframe' => 0, 'in_canvas' => 1, 'time' => time(), 'added' => 1, 'api_key' => 'api-key');
$_GET =& $params;
$_GET['fb_sig'] = Facebook::generate_sig($_GET, 'secret');
foreach ($_GET as $key => $value) {
if (strncmp($key, 'fb_sig', 6) === 0) {
continue;
}
$_GET['fb_sig_' . $key] = $value;
unset($_GET[$key]);
}
$ringside = new RedirectingClient('api-key', 'secret', 'http://localhost/web/url', 'http://localhost/server/url', 'http://localhost/social/url');
$this->assertEquals('10000', $ringside->get_loggedin_user());
$this->assertNull($ringside->get_network_id());
$this->assertNull($ringside->get_network_user());
$ringside->require_network_login();
// Confirm that the client forced a redirect; we don't care what PHP thinks the current URL is
$this->assertEquals('http://localhost/social/url/map.php?v=1.0&method=map&api_key=api-key&snid=&sid=10000&social_session_key=&session_key=session-key&next=' . urlencode(Facebook::current_url()) . '&canvas', $ringside->redirect);
}