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


PHP FacebookSession::newSessionFromSignedRequest方法代码示例

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


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

示例1: getSession

 /**
  * Instantiates a FacebookSession from the signed request from input.
  *
  * @return FacebookSession|null
  */
 public function getSession()
 {
     if ($this->signedRequest && $this->signedRequest->hasOAuthData()) {
         return FacebookSession::newSessionFromSignedRequest($this->signedRequest);
     }
     return null;
 }
开发者ID:sodacrackers,项目名称:washyacht,代码行数:12,代码来源:FacebookSignedRequestFromInputHelper.php

示例2: testSessionFromSignedRequest

 public function testSessionFromSignedRequest()
 {
     $data = array('user_id' => 4, 'oauth_token' => 'fjm', 'state' => 'wow');
     $signedRequest = self::makeSignedRequest($data);
     $session = FacebookSession::newSessionFromSignedRequest($signedRequest, 'wow');
     $this->assertTrue($session instanceof FacebookSession);
     $this->assertEquals('fjm', $session->getToken());
 }
开发者ID:jonathanbugs,项目名称:anselmi,代码行数:8,代码来源:FacebookSessionTest.php

示例3: testSessionFromSignedRequest

 public function testSessionFromSignedRequest()
 {
     $signedRequest = m::mock('Facebook\\Entities\\SignedRequest');
     $signedRequest->shouldReceive('get')->with('code')->once()->andReturn(null);
     $signedRequest->shouldReceive('get')->with('oauth_token')->once()->andReturn('foo_token');
     $signedRequest->shouldReceive('get')->with('expires', 0)->once()->andReturn(time() + 60 * 60 * 24);
     $signedRequest->shouldReceive('getUserId')->once()->andReturn('123');
     $session = FacebookSession::newSessionFromSignedRequest($signedRequest);
     $this->assertInstanceOf('Facebook\\FacebookSession', $session);
     $this->assertEquals('foo_token', $session->getToken());
     $this->assertEquals('123', $session->getUserId());
 }
开发者ID:sodacrackers,项目名称:washyacht,代码行数:12,代码来源:FacebookSessionTest.php

示例4: loginAsSignedRequest

 public function loginAsSignedRequest($signed_request)
 {
     $this->session = FacebookSession::newSessionFromSignedRequest($signed_request);
     return $this;
 }
开发者ID:jiqiang90,项目名称:laravel-restful-api-starter,代码行数:5,代码来源:FacebookWrapper.php


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