本文整理汇总了PHP中Facebook\FacebookSession::useAppSecretProof方法的典型用法代码示例。如果您正苦于以下问题:PHP FacebookSession::useAppSecretProof方法的具体用法?PHP FacebookSession::useAppSecretProof怎么用?PHP FacebookSession::useAppSecretProof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook\FacebookSession
的用法示例。
在下文中一共展示了FacebookSession::useAppSecretProof方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAppSecretProof
public function testAppSecretProof()
{
$enableAppSecretProof = FacebookSession::useAppSecretProof();
FacebookSession::enableAppSecretProof(true);
$request = new FacebookRequest(FacebookTestHelper::$testSession, 'GET', '/me');
$this->assertTrue(isset($request->getParameters()['appsecret_proof']));
FacebookSession::enableAppSecretProof(false);
$request = new FacebookRequest(FacebookTestHelper::$testSession, 'GET', '/me');
$this->assertFalse(isset($request->getParameters()['appsecret_proof']));
FacebookSession::enableAppSecretProof($enableAppSecretProof);
}
示例2: __construct
/**
* FacebookRequest - Returns a new request using the given session. optional
* parameters hash will be sent with the request. This object is
* immutable.
*
* @param FacebookSession $session
* @param string $method
* @param string $path
* @param array|null $parameters
* @param string|null $version
* @param string|null $etag
*/
public function __construct(FacebookSession $session, $method, $path, $parameters = null, $version = null, $etag = null)
{
$this->session = $session;
$this->method = $method;
$this->path = $path;
if ($version) {
$this->version = $version;
} else {
$this->version = static::GRAPH_API_VERSION;
}
$this->etag = $etag;
$params = $parameters ?: array();
if ($session && !isset($params['access_token'])) {
$params['access_token'] = $session->getToken();
}
if (!isset($params['appsecret_proof']) && FacebookSession::useAppSecretProof()) {
$params['appsecret_proof'] = $this->getAppSecretProof($params['access_token']);
}
$this->params = $params;
}