本文整理汇总了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);
}